Go Back   The UNIX and Linux Forums > Special Forums > UNIX and Linux Applications
Search Forums:



UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics.

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-04-2012
Registered User
 

Join Date: Feb 2012
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Question output redirection command

Dear All,


Code:
./waf --run scratch/myfirst > log.out 2>&1

The above is a command line to redirect the output to a file called log.out.

what is the 2>&1 part for ?

Thank you
Sponsored Links
    #2  
Old 02-04-2012
agama agama is offline Forum Advisor  
Always Learning
 

Join Date: Jul 2010
Location: earth>US>UTC-5
Posts: 1,211
Thanks: 86
Thanked 405 Times in 389 Posts
The syntax 2> instructs the shell to redirect standard error (file descriptor 2). The &1 is a reference to an open file descriptor (1) which is standard output. Therefore 2>&1 causes standard error to be redirected to the same file as standard output, so both stderr and stdout will be written, in your case, to log.out.

Last edited by agama; 02-04-2012 at 01:45 PM.. Reason: clarification
The Following User Says Thank You to agama For This Useful Post:
knowledgeSeeker (02-04-2012)
Sponsored Links
    #3  
Old 02-04-2012
Registered User
 

Join Date: Feb 2012
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
oh alright Thanks !
Sponsored Links
Reply

Tags
c++, cmd, ns2, ns3

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Output redirection mfruiz34 UNIX for Dummies Questions & Answers 1 02-06-2011 12:56 PM
Help with tar --append command output redirection pganguly46 Shell Programming and Scripting 0 02-01-2011 04:32 AM
Output redirection jolateh Shell Programming and Scripting 5 01-20-2011 03:40 AM
Redirection output kma07 Shell Programming and Scripting 6 05-12-2010 07:14 PM
redirection and output nck Shell Programming and Scripting 2 10-23-2009 01:01 PM



All times are GMT -4. The time now is 04:10 AM.