Re: Redirecting stdout & stderr
Posted in 1996
hoinj@cc.tacom.army.mil wrote: : In some of my shell Unix shell scripts, I send the stdout & stderr to : a logfile using something like - : isql -qr posttis.sql > /financ/logfile1 2>&1 : per a message posted here some months ago. Then, I scan that logfile : for errors via egrep, looking for keywords like err, Err, etc. : What I'd really like to do is direct stdout to one file and stderr to a : different file! Can that be done in one command? You have almost got it. Just replace &1 with a filename (&1 says to redirect to standard output) like this: isql -qr posttis.sql > /financ/logfile1 2>somefile or: isql -qr posttis.sql > /financ/logfile1 2>/financ/errfile1 : Alternatively, I am going to try to come up with some filter which will : strip blank lines and '1 row updated' statements, which should leave : only error messages. : Any thoughts would be appreciated. Tanks, Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org