On Tue, Mar 20, 2001 at 02:27:53PM +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 
wrote:
|  I need to do a search and replace on multiple files. I think awk should be usefull 
|for this, but I have no experience with awk at all.
|  Maybe someone has a script lying around that replaces string1 with string2 in all 
|files in a directory recursively which I can clone?
|  URL's of sites with simple awk scripts are welcome as well.

I used bsed for this:

        http://www.zip.com.au/~cs/scripts/bsed

It's a wrapper for sed (which reads stdin and writes stdout).

Thusly:

        bsed 's/this/that/' several filenames here ...

or

        find dir -type f -print | xargs bsed '/a regexp i dont like/d'

Pretty much takes the same arguments as sed (surpise surprise).

Cheers,
-- 
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

Because of its special customs, crossposting between alt.peeves and normal
newsgroups is discouraged.      - Cameron Spitzer



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to