I am using the following command line to analyse data:unpackdcm -scr ${in} -targ ${out} This command is printing on the screen status and description about the progress in the job. In order to save the status I did the following:unpackdcm -scr ${in} -targ ${out} >stat.txtBut it did not work! Kindly, what is wrong?
saving the output of command line in a text file?
shell;scripting;io redirection
The >-sign represents an I/O-Redirection. With >stat.txt you redirect the standard output (stdout) of the application to the file stat.txt. It is redirected, so you will not see any output in the shell.If you want the output in the current shell AND the file pipe the output into tee:your_command | tee stat.txtOr..your_command | tee -a stat.txt..to append to the file.Your application may also produce some errors. They mostly occure in the standard error (see standard streams). To redirect that stream use the folloing syntax:your_command 2>error.log