Bash script to return exit code from NodeJs script
2 answers
From: http://www.tldp.org/LDP/abs/html/exit-status.html
When the script ends with an exit that has no parameters, the exit status of the script is the exit status of the last command executed in the script
which means you just need to add "exit" to your above script.
#!/bin/bash
node ./bar.js
exit
+8
source to share