on Wed, Sep 17, 2003 at 04:22:15AM -0700, Ric Otte (ric@otte.ucsc.edu) wrote: > On Wed, Sep 17, 2003 at 11:40:31AM +0100, Karsten M. Self wrote: > > on Wed, Sep 17, 2003 at 08:08:26AM +0800, csj (csj@zapo.net) wrote: > > > Is there anything intrinsically wrong with: > > > > > > find directory -name "*.foo" | xargs sed -i -f sed_script > > > > Well: > > > > - It outputs everything to stdout, rather than a named file for each > > input. > > - You need to restrict the number of input files with 'xargs -n 1' > > - You could run into problems with filenames containing embeded IFS > > characters. "-print0 / -0" are useful arguments. > > > Hmm, I tried 'find directory -name "*.foo" | xargs sed -i -f sed_script' > and it worked. Evidently my version of sed knows about -i (4.0.7-1) and > the changes showed up in the original filenames, not stdout. Damnit, stop that! 1. I'm learning things. 2. "-i" was a reason to start picking up Perl over sed. ;-) Peace. -- Karsten M. Self <kmself@ix.netcom.com> http://kmself.home.netcom.com/ What Part of "Gestalt" don't you understand? Defeat EU Software Patents! http://swpat.ffii.org/
Attachment:
pgpBfyyXtbFME.pgp
Description: PGP signature