OhLordy
07-30-2003, 05:22 AM
Hi I have writen this little script to replace
document.write(id);
with
document.write(id);
document.write('&group_id=');
document.write(group_id);
this is what I came up with
for file in `find . -name '*.tpl'`
do
mv $file buffer
sed 's/document.write\(id\)\;/document.write\(id\)\;\ndocument.write\(\'&group_id=\'\)\;\ndocument.write\(groupd_id\)\;\n/g' buffer > $file
rm buffer
done
I've tried all number of different slashes but I keey getting errors. The one that I can't seem to get rid of now is
./replace: line 4: unexpected EOF while looking for matching `''
./replace: line 7: syntax error: unexpected end of file
but I can't really figure out what it's trying to say.
Thanks in advance for any help
Rob
document.write(id);
with
document.write(id);
document.write('&group_id=');
document.write(group_id);
this is what I came up with
for file in `find . -name '*.tpl'`
do
mv $file buffer
sed 's/document.write\(id\)\;/document.write\(id\)\;\ndocument.write\(\'&group_id=\'\)\;\ndocument.write\(groupd_id\)\;\n/g' buffer > $file
rm buffer
done
I've tried all number of different slashes but I keey getting errors. The one that I can't seem to get rid of now is
./replace: line 4: unexpected EOF while looking for matching `''
./replace: line 7: syntax error: unexpected end of file
but I can't really figure out what it's trying to say.
Thanks in advance for any help
Rob