How do I forward standard and error output into same file?
I run my program using the following command:
nohup sh -c "exec $RUN_CMD >>$NBWA_HOME/log/spider.log" >/dev/null & And when my program crashed there was no error messages in spider.log. I assume this is because all those message went into the error stream which was the terminal which I couldn't see because it was ran in the background... How can I forward both standard output and error output into the same file? Thanks! |
Re: How do I forward standard and error output into same file?
Quote:
According to bash manual: Quote:
Code:
nohup sh -c "exec $RUN_CMD &>$NBWA_HOME/log/spider.log" & |
Opppsss...I didn't notice the double quote `" "` within the `sh -c'...
but anyway, it should works... |
That seems to work thanks!
Although now I have a "nohup: appending output to nohup.out"... Is there any way I can move that file? |
Quote:
Code:
~$ nohup sh -c "exec ls &>_filename_.log" > /dev/null |
ohh get it now thx :P
|
All times are GMT -5. The time now is 05:08 AM. |