[NTLUG:Discuss] sed script

terry trryhend at gmail.com
Tue Jan 27 17:32:19 CST 2009


Hey, that works great.  Thanks very much.

On Tue, Jan 27, 2009 at 2:45 PM, Chris Cox <cjcox at theendlessnow.com> wrote:
> On Tue, 2009-01-27 at 14:37 -0600, terry wrote:
>> I found and adapted a script to do a particular job, (to change one
>> word in multiple files).
>
> Like:
>
> find . -type f -print0 | xargs -0 perl -pi -e 's/oldword/newword/g'
>
> print0 helps with funky filenames (spaces, etc) by output a list
> of names separated by the NULL character... the -0 reads a list
> so separated to xargs and passes as many files as the command line
> can handle to invocations of the perl command which does the inline
> substitution.
>
>
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>



-- 
<><



More information about the Discuss mailing list