Re: Redirecting stdout & stderr
Posted in 1996
Joe, You might try: isql 1>/financ/logfile1.out 2>/financ/logfile1.err -qr posttis.sql - or - isql >/financ/logfile1 2>&1 -qr posttis.sql I think that it is the output from isql which you wish to redirect. Your command line: isql -qr posttis.sql > /financ/logfile1 2>&1 is redirecting the standard output (1) from posttis.sql to logfile1, and is also redirecting standard error (2) to the same location as standard output (1) via 2>&1 but is not dealing with any output directly from the isql command. Of course, things might behave differently on your port of UNIX. -- Regards, Walter S. Tyszka (wstyszka@ingr.com) * Standard disclaimers apply * > > 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? > > 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, > > Joe Hoin > US Army Tank-Automotive & Armaments Command > hoinj@cc.tacom.army.mil >