the previous probly won't work.
I usually end up saving stderr to
a file and then checking to see
if it's got any errors in.
trouble is you can lose the context of the errors
in relation to stdout messages.
be interested if anyone knows a better way, been bugging me
for ages this sort of thing!
here's an example standalone that works...
Code:
do_it()
{
exec 6>&2 # save stderr
exec 2> err.log # redirect stderr to error log
cat <<EOF
### running:"$@"
EOF
rsh primaappdev "$@"
if [ -s err.log ];then # if error log contains data
cat - err.log <<EOF
ERRORS:
======
EOF
else
: echo SUCCESS
fi
exec 2>&6
}
# LOOP code here
do_it date
do_it fig
Code:
billym.primadtpdev>bash ./rsh
### running:"date"
Thu Jan 6 11:48:17 GMT 2005
### running:"fig"
ERRORS:
======
ksh: fig: not found