#!/bin/sh
#] 
#] *********************
#] $ bash "$d_bin"'webLocal/webLocal run mass changes one-time.sh'  - 
#]    special mass changes to webLocal, but much emphasis on p[Htm, Lnk][Nlk, Nwp, Web]L
# www.BillHowell.ca  01Mar2023 initial, 13Nov2025 fRename
# view in text editor, using constant-width font (eg courier), tabWidth = 3
#]    "$d_bin"'webSite.link.txt' - shows [how-to, results of] file-checks of past updates!!


# see also:
#		"$d_bin"'webLocal/1_webLocal links.txt': links for webLocal local maintenance (NOT webUploads!)
#			shows [how-to, results of] file-checks of past updates!!
# see instructions below as used to run this file
#24************************24



#24************************24
# List of operators, generated with :
# $ grep  "^#] "  "$d_bin"'webLocal/webLocal run mass changes one-time.sh' |  sed "s|^#] |   |"  >"$d_bin"'webLocal/webLocal run mass changes one-time.sh'' TblOfCont.txt'
#  


# find active run functions: 
# $ grep  "^[ 	]*[A-Za-z0-9_]\+[ 	]\+.*#"  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'
# note 	use of tab key in grep search expression
# func defs come BEFORE 'titleLine capture for TableOfContents: 
#		uncomment (delete '#]') of titleLine to run choice, BUT put back later!
# +--+
#] [toRead, revisit]*[paper, email, vid,etc]s, use |*|  anywhere in doc - pulls out line
# $ grep  "\(|\*|\)"  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'  |  sed 's|^#\] ||' 


#24************************24
# Setup 

#	source  "$d_bin""standard header.sh"	# not here - done by fileops.sh
source  "$d_bin"'webLocal/webLocal library.sh'

#	A variety of 'fileops run' bash scripts are in project directories, where it is perhaps easier to see the [data, intermediate results, etc] for scripts in the context of that project.
#	
#	A major reason for creating these "fileops run *.sh" files was to have a description of [manual, script] combinations of steps for a specific process.   This should be enormously helpful [say, month, year]s later when the process has to be : [repeat, modify, used elsewhere].
#	
#	Here is a listing of 'fileops run' bash scripts, built by : 
#	$ find "$d_web"  -type f  -name "fileops *run*.sh*"  |  sort  
#	"$d_web"'bin/0_test/fileops/fileops test run.sh
#	"$d_web"'bin/bin logs/fileops run Grossberg imageCaptions log.sh
#	"$d_web"'bin/webLocal run mass changes one-time.sh
#	"$d_web"'bin/fileops run webSite loPriority.sh
#	"$d_web"'bin/fileops run webSite template.sh
#	"$d_web"'bin/fileops run webSite update local.sh
#	"$d_web"'bin/fileops tests run.sh
#	"$d_web"'bin/z_Archive/fileops run webSite 240107 20h41m22s.sh
#	"$d_web"'Neural nets/consciousness/webWork/z_Archive/fileops run TrNN_ART.sh
#	"$d_web"'Neural nets/Grossberg/webWork/z_Archive/fileops run TrNN_ART.sh
#	"$d_web"'Neural nets/Transformer NNs/z_Archive/webWork/z_Archive/fileops run TrNN_ART.sh
#	"$d_web"'Neural nets/TrNNs_ART/webWork/z_Archive/fileops run TrNN_ART.sh


#] ToDos
#	?ddAug2023? webLocal_steps: I need to use unix make as process is semi-manual
#  30Aug2024 the "steps" aren't helping, as  checks are needed for almost alll functions!



#24************************24





#  08********08
#  revamp work  - major changes from earlier processes, revamped web[Page, Dir]s (no longer pertinent)
#     preps for onLine work, including [dWebHtmlOnly, lftp upload]  - not created, DON'T USE?!?!?!
#     see "$d_bin"'webLocal/z_Archive/webLocal run historic 250504 12h15m.sh'  


#] 08********08
#] run  - first edit [function, expression]s below, check that only one is "active"
#	then manual checks after each function call
#		short-cuts aren't worth the trouble of cleaning up big messes

#] Handy geany regxpr search-replace commands while working 
	# see bottom of "$d_bin"'webSite update notes.txt'
	# create "$d_webWork"'pStrPAll_L change.txt' from "$d_webWork"'pLnkBad.txt'
	# check "$d_webWork"'pStrPAll_L change.txt' for non-tabbed lines
	# [add, replace]*[class] for "home" : 
	# bookmarks search-replace
	# fix TblOfContents :
	# MenuTop geany regexpr search-replace : 
	# add p_log to each fileops.sh function except those that iterate many times :
	# (*) see  "Handy geany regxpr search-replace commands while working"  
	#			in "$d_bin"'webSite update notes.txt'  - LOCAL d_web update, notes



#] +-----+
#] special work functions : 
	#work_240224
	#funcTest_pLog						# 30Aug2024 see "$d_bin"'webSite library.sh'

#] htmlHeadings_to_TblOfContents: see "$d_bin"'webLocal/webLocal [find, fix, create] normal details.sh'


# $ grep  "^[ 	]*[A-Za-z0-9_]\+[ 	]\+.*#"  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'
# $ bash  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'  

#] replace webPage header, reminder - must escape linP (strt, endd)
#]    Google Analytics no longer used: too com[plicated to set up
	# 11Nov2023 still has mistake!!! don't use until fixed!
	#    see "$d_SysMaint"'webSite/0_website bash notes.txt'  10Nov2023 manually fix



#] pWebPageL_str_extractPthLWithStr_pout      #(no args) list str occurences with [fNam, linNum]
	# results are in "$d_webWork"'pWebPageL_str_extractPthLWithStr_pout log.txt'
	# useful for finding bad links, must escape problematic chrs
	#pWebPageL_str_extractPthLWithStr_pout  '/TrNNs_ART/webWork/status Grossbergs overview.html'		#
	#pWebPageL_str_extractPthLWithStr_pout  '/web/webWork/pMenuTopHelp TrNNs_ART.html'		#


# $ grep  "^[ 	]*[A-Za-z0-9_]\+[ 	]\+.*#"  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'
# $ bash  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'  


#] Special recovery of earlier file verseions in case something foes wrong
	#pBadL_archive_pArchiveL_restore  "$d_webWork"'pHtmlPathAll_L.txt'
	#webLocal_strP_replace							# (no args) strP replace in website 


#] replace webPage header, reminder - must escape linP (strt, endd)
	# 11Nov2023 still has mistake!!! don't use until fixed!
	#    see "$d_SysMaint"'webSite/0_website bash notes.txt'  10Nov2023 manually fix
	# full header - careful, may have to redo all menus!?!? : 
	#    be careful - may not be appropriate!!
		#pOvL="$d_webWork"'pHtmlPathAll_L.txt'
		#pStP="$d_webWork"'pStrP header.txt'
		#pIns="$d_webWork"'pHeader template.txt'
		#pOvrL_pStrP_pIns_replaceLines  "$pOvL"  "$linP"  "$pIns"




#] str_get_links (new funcNam - later)
	#para='/home/bill/web/ProjMajor/Stalin supported Hitler/Howell 131202 - Adolph Hitler,  Unknowing puppet on a string of Joseph Stalin, video script.pdf">unfinished scripts</a>] are provided in the <A HREF="/home/bill/web/ProjMajor/Stalin supported Hitler/">Stalin supported Hitler (video production) directory</a> and <A HREF="/home/bill/web/ProjMajor/Icebreaker/">Icebreaker directory</a> (which should be combined into one).  Two very simple animations took sooooo loooong to produce.  They total only ~ 1 minute for both "A year of stunning victories" map scan-zooms of the <A HREF="/home/bill/web/ProjMajor/Stalin supported Hitler/animations - Howell/Opening_Context/01.1 A_year_of_stunning_victories/01-1 A_year_of_stunning_victories.ogg">Poland, false war, lowlands, France</a> and <A HREF="/home/bill/web/ProjMajor/Stalin supported Hitler/animations - Howell/Opening_Context/01.5 A_year_of_stunning_victories/01.5 A_year_of_stunning_victories.ogg">Dunkirk</a>).  Worse, the unfinished part 1 of 6 videos (!1 hour length) wasnt saved to a complete file, and the software to  it needs massive updating.  The vidoes are in ogv format (.ogg)- use the VLC media player to view (some other media programs also work).<BR>'
	#str_get_links  "$para"  '<A HREF\=\"'


# $ grep  "^[ 	]*[A-Za-z0-9_]\+[ 	]\+.*#"  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'
# $ bash  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'  

# 06May2025 I need these!! regenerate 
	#webLocal_get_internalLinksWithFnamLinNum	#(pHtmlOnly pFnmLinumLnk) locate internal links (debugging)
	#pWebPag_sedStrt_get_pLnkL						#(sedStrt pWebPag) extract lnkL with [start, end] code


#] webSite extensions: generate pLnkIntNoBmkLsts for each of [html, txt, ods, png, jpg, etc]
	#not created yet (used to have) 			# generate pthLsts of Howells [web, Href, Img, Extrn]


#] povrL_pStrP_replace  1  1  "$pWebYes769"  "$pStrPL_769"		#

	pHtmNwpL_renameNoLinksAs_pHtmNlkL()
{ 
	# make bash file to rename files :
	date_ymdhms=$(date +"%0y%0m%0d %0kh%0Mm%0Ss")
	sed  "s|\(.*\)|mv  '\1'  '\1'.HtmNlk.html|"  "$d_webWork"'pHtmNwpL no links.txt'  |  sed "s|\.HoNwp\.html'\.HtmNlk\.html|.HtmNlk.html'|"  >"$d_webWork""pHtmNwpL rename no links as HtmNlk $date_ymdhms.sh"
	#>> 14Nov2025 looks OK!!  just had to fix a fName that had an apostrophe (yikes!! - screwed up entire bash file!)
	bash "$d_webWork""pHtmNwpL rename no links as HtmNlk $date_ymdhms.sh"
}  
#] pHtmNwpL_renameNoLinksAs_pHtmNlkL		#(no args)  - mass file renaming via create a bash file


	pHtmGrossbergCaptionL_renameAs_pHtmNlkL()
{ 
	date_ymdhms=$(date +"%0y%0m%0d %0kh%0Mm%0Ss")
	pShGrossCapL="$d_webWork$date_ymdhms Grossberg captions rename.sh"
	#find  "$d_neural"'Grossberg/captions html/' -type f  -name '*.html'  |  sed  "s|\(.*\)|mv  '\1'  '\1.HtmNlk.html'|"  |  sed "s|\.html\.HtmNlk\.html|.HtmNlk.html|"  >"$pShGrossCapL" 
	 find  "$d_neural"'Grossberg/captions html/' -type f  -name '*.html'  |  sed  's|\(.*\)|mv  "\1"  "\1.HtmNlk.html"|'  |  sed "s|\.html\.HtmNlk\.html|.HtmNlk.html|"  >"$pShGrossCapL" 
	# test above lines first BEFORE uncommenting!!! : 
	bash "$pShGrossCapL"
}  
#] pHtmGrossbergCaptionL_renameAs_pHtmNlkL	#(no args)  - make bash file to [rename files, see in listing]!
# 15Nov2025 initial
# DANGEROUS!: check before uncommenting last line!  extra [quot, apo]s makes for really bad script!


# $ bash  "$d_bin"'webLocal/webLocal run mass changes one-time.sh'  


# enddoc
