On Sat, 10 Mar 2001, [EMAIL PROTECTED] wrote:
> On Sat, 10 Mar 2001, Chris Rodliffe wrote:
> 
> > I have a query - is there any cunning way (using  grep or some similar
> > command)  to replace a short text string in all the files in a directory
> > with another specified string?    I know many things are possible with
> > Linux, just wondering if that is?
> >
> > Chris
> > -
> If you don't want to bother with perl,
> 
> find <directory> -type f |xargs -i sh -c "sed 's/shor\
> t text string/another specified string/g' {} |safe {}"
> 
> The backslash at the end \
> of the first line I just used to continue the command before it would
> get folded in the mail - it has no syntactical significance otherwise.
> 
> You can get safe at
> 
> http://www.ibiblio.org/pub/Linux/utils/text/safe-2.0.8.1.tar.gz
> 
> I think that is where ftp://metalab.unc.edu is now.  I can mail you a
> copy if you can't find it.
> 
> Once you install it, man safe and [p]info safe have a few examples.
> 
> Lawson
> 

'man safe' works on my system too, so I guess I already have it.

Linux is just packed full of neat goodies that I don't even know are there
unless some kind person tells me.   

Perl or Safe oughta do it, one or the other.

Many thanks!

I think what I really need is some program called 'Index' that will list every
program on my system and just what it can do.    ;-)

Chris
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to