I'm implementing the logging solution presented here, and I don't know if the following lines are required whenever I exit the parent Bash process/script:
if [ -n "$teepid" ]; then exec 1>&- 2>&- # Close file descriptors to signal EOF to the `tee` # command in the background process wait $teepid # Wait for background process to exit fi
Those lines can be found in the
log() function and in the end of the script. I know that they're required in the
log() function, but are they required at the end of the script?
In other words: Would my background job exit nicely without having the aforementioned code written before every
exit command in my parent process?