[Tfug] Quick command line question...

Calvin Dodge caldodge at gmail.com
Wed Mar 10 08:53:56 MST 2010


On Wed, Mar 10, 2010 at 8:51 AM, Ryan Cresawn <jrcresawn at gmail.com> wrote:

> Jim,
>
> Make a backup of the directory before you mangle your data by trying this
> bash script. I think it's safe, but it's untested.
>
> for i in *.TXT; do
> ed $i<<END
> 1,$s/regurjitation/regurgitation/g
> w
> q
> END
> done
>
> Good luck,
> Ryan
>
>
In the Perl tradition of TMTOWTDI, I use:

perl -pi -e s/regurjitation/regurgitation/g $(find ./ -name '*.TXT' -type f
-exec grep -l regurjitation)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20100310/5a76ad82/attachment-0002.html>


More information about the tfug mailing list