process1 | process2
retval=(${PIPESTATUS[@]})
[ ${retval[0]} != 0 -o ${retval[1]} != 0 ] && echo "There was an error...."
process1 | process2
retval=(${PIPESTATUS[@]})
[ ${retval[0]} != 0 -o ${retval[1]} != 0 ] && echo "There was an error...."