> A few years ago, I'm sure I came across a one-line way of replacing
> every occurence of one string with another in an entire directory of
> files (potentially including all subdirectories as well).  I think it
> used sed or awk.  Now I can't find it.  The examples on the Web are all
> multiline scripts or programs, but I'm sure I saw a way to do it all on
> just one line.
> 
> Can anyone tell me how to do this?

Try this.

Global search and replace, with backup:
# find . -type f | xargs sed -i.bak "s/oldtext/newtext/g"

-- 
Kids can get a free PlayStation 2!
http://www.landoverbaptist.org/news0104/ps2.html
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to