How to make the same change in multiple shell scripts?

I would like to make the same change in multiple shell script files and would like to know if anyone can be of some help? I would appreciate it.

What do you want to change in the script, programming code or only variables?

If you want to change variables you can put these in a file. You read these variables by using commands like grep and awk print.

If I understand you correctly you want to change one specific regex in a script to another. you can use sed to do global substitutions.

sed -e s/foo/bar

Build a list file with
ls > listfile and edit it. Then:

listfile=/path/to/listfile
for i in $listfile
do
sed -e s/foo/bar $i
done
echo Return Code: $?

The echo at the bottom will return a 0 or a 1 .. 0 if successfull and 1 if it fails.

jiin

you use following script

for file in $*
do
sed 's/string/string1/g' $file>,$file
mv ,$file $file
done

i hope this will help u

if you have gnu sd

sed -i 's/string/string1/g' file*