Re: Redirecting stdout & stderr
Posted in 1996
In article <52gk6t$hot@cssun.mathcs.emory.edu>, hoinj@cc.tacom.army.mil writes: > 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? Yes it can. What you're actually doing above is: > /financ/logfile1 redirect stdout (1) to logfile 2>&1 redirect stderr (2) to stdout (1) So, shat you want is: isql -qr posttis.sql >/financ/logfile1 2>/financ/errfile1 Hope this is what you want, Pete Pete