I am sure this has been covered but not sure how to find the answer:
#!/usr/bin/env bash set -e; false & wait; echo "lol"
if we run this, we get "lol".
Is there a way to exit the script if the background command (in this case "false") exits with non-zero?
In this case,
set -e; does not seem to prevent the script from continuing if a command exits with non-zero, if that command is run in the background.