The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to use tee with stdout and stderr? siegfried Shell Programming and Scripting 3 01-14-2009 10:07 PM
Redirecting STDERR message to STDOUT & file at same time vikashtulsiyan Shell Programming and Scripting 10 04-09-2008 02:34 PM
precedence of stderr and stdout new2ss Shell Programming and Scripting 1 06-08-2006 11:03 PM
STDOUT and STDERR going to a system log longyie904 Shell Programming and Scripting 1 09-11-2002 11:42 PM
Redirect stdout and stderr zcurtis Shell Programming and Scripting 8 09-02-2002 06:13 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-20-2007
jshinaman jshinaman is offline
Registered User
  
 

Join Date: Jun 2007
Location: USGS Astrogeology Research Program, Flagstaff, AZ
Posts: 5
redirecting STDOUT & STDERR

In bash, I need to send the STDOUT and STDERR from a command to one file, and then just STDERR to another file. Doing one or the other using redirects is easy, but trying to do both at once is a bit tricky. Anyone have any ideas?
  #2 (permalink)  
Old 06-20-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
my_command >/my/file 2>&1

bash has a shortcut for this

my_command &>/my/file

Cheers
ZB
  #3 (permalink)  
Old 06-20-2007
jshinaman jshinaman is offline
Registered User
  
 

Join Date: Jun 2007
Location: USGS Astrogeology Research Program, Flagstaff, AZ
Posts: 5
That works for combining them, but I need to capture both in one file and capture SDTERR in another file. Can you go further?
  #4 (permalink)  
Old 06-20-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
my_command >/path/to/stdout.txt 2>/path/to/stderr.txt

man bash for details
  #5 (permalink)  
Old 06-20-2007
jshinaman jshinaman is offline
Registered User
  
 

Join Date: Jun 2007
Location: USGS Astrogeology Research Program, Flagstaff, AZ
Posts: 5
That command will separate them in separate files, but again, I need both in one file and just STDERR in another file.
  #6 (permalink)  
Old 06-20-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Try "tee" for the stderr.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0