Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-21-2005, 07:18 PM   #1
Registered: Jan 2004
Location: Georgia
Distribution: OS X, CentOS
Posts: 669

Rep: Reputation: 34
using > to store output


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
$ 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?

Old 01-21-2005, 07:27 PM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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.
Old 01-21-2005, 07:51 PM   #3
Registered: Jan 2004
Location: Georgia
Distribution: OS X, CentOS
Posts: 669

Original Poster
Rep: Reputation: 34
strange usage...

Cool, thanks


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
store output of iwconfig ppb Linux - Wireless Networking 1 04-13-2005 12:59 AM
How do i store the output of an rpm or source to file? dr_zayus69 Linux - Software 8 03-07-2005 09:03 AM
'alsactrl store' doesn't seem to store... endfx Slackware 1 08-20-2004 01:30 AM
the sound gives output when using mic but no output when run a music file medo Debian 0 04-19-2004 07:17 PM
store output of cmd in array? h/w Programming 6 10-09-2003 08:46 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration