I am using sed in a script to edit several hundred files. I want to basically do a search and replace, but the search uses wildcards. The replace is the same for each file.
For example, most files contain the line
and I want them all to be changed to:
I initially tried the following script:
This causes no errors, but doesn't change the files. Does anybody know what I'm missing?
For example, most files contain the line
Code:
Return_Address=[i]zero or more characters[/i]
Code:
Return_Address=customer_service@myhost.com
I initially tried the following script:
Code:
instring='Return_Address=*\n';
outstring='Return_Address=customer_service@myhost.com\n';
for i in `ls *.ini`
do
cat $i | sed s/$instring/$outstring/g > new_inis/$i;
done
This causes no errors, but doesn't change the files. Does anybody know what I'm missing?