█████ ██ ██ ██ █████ ██████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ██ ██ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ████ ██ ██ ██ ██ ██████
From @saruspete's tweet, ${PIPESTATUS[@]} gives ya all piped commands' return codes:
echo foo | grep bar | tr z a | cat echo ${PIPESTATUS[@]}