Anthony Atkielski <[EMAIL PROTECTED]> writes:

> 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?

You should be able to figure this out pretty quickly on your own from
the manual, but I'll do your homework for you...

find . -type f -exec sed -i "" -e "s/e/E/g" {} \;

[changes every lower-case e to upper-case in all regular files in this
directory and all directories "below" it]

[There are several other ways to do it, too, in about the same amount
of typing.  In particular, using xargs(1) instead of -exec could make
it run faster if you have large numbers of files.]
_______________________________________________
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