I started a program written using Node.js and started it using launch pipe into logfile and send it to background.Half way running the program exited w/o any error both on the console nor the log, I even checked the /var/log/message and no way I could figure out what's wrong with the program.Are there any better way to able to capture the error/messages that causes the exit?The current execution bash script is following:./run_all_with_logs >> logs/my.log &
Unable to capture program exit
shell;io redirection;exit
Let's enhance P.T.:s answer just a little.The basic form sends all normal output to the log file../run_all_with_logs >> logs/my.log &If we redirect the errors we can log both the errors and the normal printouts../run_all_with_logs 2>&1 >> logs/my.log &If we then executes the command in a subshell we can print the exit code as well.(./run_all_with_logs ; echo Final Exit Code: $? ) 2>&1  >> logs/my.log &