Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!mcsun!corton!chorus!bp From: bp@chorus.fr (Bruno Pillard) Newsgroups: comp.unix.shell Subject: Re: cat, pipes, and filters Message-ID: <10918@chorus.fr> Date: 3 Jun 91 09:43:04 GMT Article-I.D.: chorus.10918 References: <1991May31.165446.1530@progress.com> Sender: news@chorus.fr Lines: 24 From article <1991May31.165446.1530@progress.com>, by root@progress.COM > However, the following command gives me the result I want: > > cat $FILE | sed s/"$ENTRY"/"$NEWENTRY"/ | tee $FILE 1>/dev/null > > Any enlightenment would be appreciated. What about: ( /bin/rm $FILE ; sed s/"$ENTRY"/"$NEWENTRY"/ > $FILE ) < $FILE I understand that this may look harmful at first glance because of the /bin/rm of your precious file but it works perfectly for me under sh and (t)csh. Is there any problem using that construction ? __ / ) Bruno Pillard /--< __ . . __ __ Chorus Systemes /___/_/ (_(_/_/) )_(_) 6 Avenue Gustave Eiffel 78182 St-Quentin-en-Yvelines-Cedex France bp@chorus.fr (Internet) Tel: +33 (1) 30 64 82 13