Quote:
|
Originally Posted by Perderabo
This depends on the shell. ksh can smash through that wall by moving the "tail -15" to a co-process. I don't know that cleartool command so I'll use "cat /etc/passwd" for my example:
Code:
#! /usr/bin/ksh
exec 4>&1
tail -5 >&4 |&
exec >&p
cat /etc/passwd
exitcode=$?
exec >&- >&4
wait
echo exitcode = $exitcode
exit 0
|
I use this technique as well however, on occassion, I'll use the following, if I know that I'll be parsing the output anyway:
Code:
set -A ARRAY $(
somecommand
print RC=$?
)
for i in ${ARRAY[@]}
do
case $i in
RC*) ... ;;
whateverelse) ... ;;
esac
done