Can somebody explain to me why the diff output is not going to stderr?
Yet when I issue a diff from the command line the return code is -ne 1.
I am guessing diff always writes to stdout???
Is there away I can force the difff to write to stderr USING THE CURRENT
template. If possible, I would like to uncomment the first diff and get
that to write to stderr. Any examples would be greatly appreciated.
This needs to work with ksh.....
Thanks in advance to all who answer
cat /tmp/t1.ksh
============
#!/usr/bin/ksh
CheckForError()
{
ERR_NUM=$1
touch alert_${ERR_NUM}.now alert_${ERR_NUM}.prv
grep ${ERR_NUM} /tmp/alert.log > /tmp/alert_${ERR_NUM}.now
##diff /tmp/alert_${ERR_NUM}.prv /tmp/alert_${ERR_NUM}.now | grep '>'| cut -c3-
diff /tmp/alert_${ERR_NUM}.prv /tmp/alert_${ERR_NUM}.now
}
main()
{
for error_num in ORA-04030 ORA-04088
do
CheckForError $error_num
done
} >$OUTPUT_FILE 2>$ERR_FILE
OUTPUT_FILE=/tmp/junk1.out
ERR_FILE=/tmp/junk1.err
main
return 0
cat /tmp/alert.log
==============
ORA-04030: out of process memory when trying to allocate 8528 bytes
ORA-04030: out of process memory when trying to allocate 2072 bytes
ORA-04030: out of process memory when trying to allocate 1280 bytes
ORA-04088: error during execution of trigger 'XXX.INS_TRIG'