I have a script that needs to launch a program in order for the program to create and populate some folders. The program only needs to run briefly and then close, before the script continues.
However when the program is killed, the script does not continue. How can I do this?
printf "before"
(timeout -sHUP 3s firefox)
printf "after"
I thought I was launching the program in a subshell but i am not sure if this is the case.
timeoutreturns an non-zero exit status when it kills the program that it runs. Ifset -e(or, equivalently,set -o errexit) is in effect when that happens, the script will stop immediately and silently. The parentheses ((...)) ensure that the program is run in a subshell. That doesn't change the effect of theerrexitsetting, and it's not clear why a subshell is being used here.set -o errexitset indeed. Any way to ignore the timeout error specifically but keeperrexit?