# make sure we can wait for the last process substitution, since it sets $!
cat <(exit 123) >/dev/null
wait "$!"
echo $?