LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 01-21-2005, 07:18 PM   #1
student04
Member
 
Registered: Jan 2004
Location: USA
Distribution: macOS, OpenBSD
Posts: 669

Rep: Reputation: 34
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
 
Old 01-21-2005, 07:27 PM   #2
homey
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
student04
Member
 
Registered: Jan 2004
Location: USA
Distribution: macOS, OpenBSD
Posts: 669

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

Cool, thanks
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:57 AM.

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