I have this bash script:echo x & X=$!echo y & Y=$!( echo z ; exit 0; ) & Z=$!  # this linewait ${X} && echo X $? wait ${Y} && echo Y $? wait ${Z} && echo Z $? when I change exit 0 to exit 1, the last echo statement of the script does not execute. For example, here is the output when the exit code is 0:xX 0zyY 0Z 0but when I change it to 1:xyX 0zY 0I am assuming what's in the parentheses should be executed in a subshell. Anyone know why my code does this?
Subshell exit code affects logging
bash;shell script