LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   using > to store output (https://www.linuxquestions.org/questions/linux-general-1/using-to-store-output-280670/)

student04 01-21-2005 07:18 PM

using > to store output
 
Hey,

I run a script that calls upon a simple java program multiple times, telling it to access specific files that make it throw error messages. The script has a few "echo" lines in it, as well. When i run the script like this
Code:

$ sh testErrors.sh > errors.out
only the lines in the script that echo text to the console show up in the file, and the error messages from the java program go to standard output and not the file. How can i make all output to the console get redirected to that file?

Thanks :)

homey 01-21-2005 07:27 PM

Output redirection:
0 = stdin input device such as keyboard
1 = stdout output device usually the console
2 = stderr error message usually displayed at the console
Example: ls nofile > test 2>&1 This sends 1 and 2 to a file called test.

student04 01-21-2005 07:51 PM

strange usage...

Cool, thanks


All times are GMT -5. The time now is 02:40 PM.