I have a c++ code got started by a shell script. The shell script has the following line to start the c++ code /home/user/test_client/a.out
Now i want to capture the output of this code in a file called message.log
What is the right way to do this ? I have tried /home/user/test_client/a.out >> message.log
It doesn't work. Am I doing anything wrong here ?
Linux – How to run c++ and get the output in a log file
linuxshellUbuntu
Related Topic
- Ubuntu – running a bash script as root to change the date, when called by a php script
- Linux – wrong with the expect script
- Linux – “cd” in linux shell script returns “command not found!”
- Linux – Bash Prompt Below Output – Background Log Tail
- Linux – Filter the output of a log file
- Linux – Hide the output of a shell command only on success
Best Answer
Try a.out >> message.log 2>&1
That will also redirect stderr, which is probably where the messages are going.