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 > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 09-28-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,211
Quote:
Originally Posted by jim mcnamara View Post
The errors are going to stderr (2) Normal output goes to stdout (1)

Code:
$ ./Engine 2>&1 > ../engine_output.txt
This makes both streams go to ../engine_output.txt
It won't make both streams go to the file becasue 2 is duplicated to 1 before 1 is redirected to the file. As a result stdout goes to the file and stderr goes to stdout.
Code:
$ ./Engine > ../engine_output.txt 2>&1