No subject


Thu Sep 25 07:53:37 UTC 2008


don't need the 1,$

Create a file (lets say sedfile):
s/<%/<?/g
s/%>/?>/g
s/response\.write/echo/g
s/stepno/\$stepno/g
s/coredataref/\$coredataref/g

call sed with:

# sed -f sedfile filename >newfilename

*sed will not overwrite the same file, its a two step process if you want
to do that. Perhaps you could use this shell script:

for i in file1 file2 file3;
do
sed -f sedfile $i > tmp.$i
mv -f tmp.$i $i;
done

Which will process the for loop, loading variable i with file1, pass it to
sed, which creates the copy in tmp.file1, and then the mv replaces the
original, then the for loop moves on to file2.

-- 
John







More information about the Sussex mailing list