Just use vi and use the %s/foo/bar/g then save it unless you don't want
to do it interactively, then I'd use a tmp file, just as easy.

Scott

On Sat, 2003-01-04 at 10:24, Marco Shaw wrote:
> What I want:
> Take file.txt and *strip* out "foo" and replace with "bar", *but* I
> don't want to redirect to a tmp file or anything:  I would like one
> command.
> 
> Perl:
> 1. perl -pi -e 's/foo/bar/g' file.txt
> 
> SED, for example:
> 1. sed 's/foo/bar/g' file.txt > file.txt.tmp
> 2. mv file.txt.tmp file.txt
> 
> So perl does what I want to, but I'd prefer to stay with awk, sed, or
> whatever GNU utils, if possible.
> 
> Can it be done?
> 
> Marco
> 
> 
-- 
Scott Croft <[EMAIL PROTECTED]>



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to