I have a Bash script which runs a node script as part of its tasks. I would like the bash script to exit with the same exit code as the node script. Simplified example below.
process.exit(1); //sometimes the exit code can be 0
Best How To :
When a script ends with an exit that has no parameter, the exit status of the script is the exit status of the last command executed in the script
which implies that you simply need to add "exit" to your above script.