Site icon Swifty blogja

[ENG] Bash pipe return values

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

Exit mobile version