AThinkTank
AThinkTank
The Think Tank devoted to your internet needs.
We provide internet solutions that will save you both time and money.
Home
Services
AThinkStats
Resources
Partners
Contact Us
Sitemap
Resources
Scripts Resource Links
Listing of Script sites
Scripts
Script Basics
sample looping script
echo acting on something pushd . cd \a place\ copy /Y/B/V \startdata\*.xml \someplace\ for %%X in (\someplace\*.xml) do runbat.bat -param %%X > %%X.load.log popd echo Done
Search and replace bash script
#!/bin/sh #Shell script that will find string A and replace it with string B # in this case, string A is "string/with/escapes" and B is "replaceString" # uses a file copy then replace. echo starting for i in `grep -srH "stringToLookFor" /path/to/files/to/search/* | awk -F : '{print $1}'` do sed -e 's/string\/with\/escapes/replaceString/g' < $i > $i.new mv $i.new $i done echo done