From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <102653647622084.tru64-unix-managers.marc@archive.invalid> From: Jerry Brady Date: Thu, 24 May 2001 12:30:52 +0000 To: tru64-unix-managers Subject: SUMMARY:how to make substitution in files X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=102653647622084 Many thanks to: Dr. Blinn Bryan Dunlap Bob Vickers Kevin McDonnell Nikola Milutinovic Sreenivasa Prasad Robert Mulley Tom Webster I recieved other responses that suggested I read the man page on sed. My problem was that I did not know how to make sed put the change back into the orginal file. The people listed above gave me many ways to do that in the korn shell and some perl solutions. I feel like a kid in a candy store right now. I will show you the korn shell example and if you would like to see the other ones send me an email and I will forward them to you. for x in * do echo $x sed -e 's/dst_prod/dst_test/g' $x > ${x}.new mv ${x}.new $x done here is one using the find command: find . -type f -prune -exec grep -l dst_prod | while read f ; do sed 's/dst_prod/dst_test/g' $f > /var/tmp/$$ ; mv /var/tmp/$$ $f done Again, thanks to all, this is the best mailing list!