[lug] Changing files on-the-fly - Consensus? Consider this:

Paul E Condon pecondon at peakpeak.com
Tue Sep 16 16:55:16 MDT 2003


On Tue, Sep 16, 2003 at 10:03:39AM -0600, Jeff Schroeder wrote:
> Zan wrote:
> 
> > As someone else said, perl has the -i switch which will do the
> > temporary file in the background where you cannot see it.
> 
> That seems to be the consensus... use Perl (or mmap, yikes!).  I figured 
> as much; I was just checking if anyone knew of an easy way to use shell 
> redirection or grep/sed magic to process a file.  Apparently not. ;)
> 
> Thanks for the suggestions, all.
> Jeff
> 
Try this:

cat numbers.txt | egrep -v three >numbers.txt 

Of course there really IS a temp file in the pipe, but you don't have   
to create it explicitly


-- 
Paul E Condon           
pecondon at peakpeak.com    




More information about the LUG mailing list