Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

unix and linux operating commands

Confusion about 1>&2 and 2>&1

Shell Programming and Scripting


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 06-03-2008   -   Original Discussion by navi
navi's Unix or Linux Image
navi navi is offline
Registered User
 
Join Date: Jun 2008
Last Activity: 21 October 2008, 7:30 AM EDT
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
Confusion about 1>&2 and 2>&1

Can anybody tell me the difference between 1>&2 and 2>&1?
The Following User Says Thank You to navi For This Useful Post:
munnangi (05-18-2012)
Sponsored Links
    #2  
Old Unix and Linux 06-03-2008   -   Original Discussion by navi
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 7 January 2018, 1:26 PM EST
Location: NM
Posts: 11,277
Thanks: 581
Thanked 1,123 Times in 1,035 Posts
1 is stdout 2 is stderr

By default stdout is the "normal" stream for program out, stderr is for errors and warnings only. Both of those statments combine stdout and stderr into one stream - the first places all stderr and stdout output on 2, the second places all output on 1
Sponsored Links
Closed


Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Confusion about IFS Variable Awadhesh Shell Programming and Scripting 7 03-05-2008 06:28 AM
'tr' confusion Nafanja UNIX for Dummies Questions & Answers 2 12-05-2007 11:47 PM
Sed confusion alfredo123 Shell Programming and Scripting 3 11-17-2006 12:16 PM
ftp confusion intern UNIX for Dummies Questions & Answers 1 06-08-2006 07:20 PM
ISO Confusion? Mr_Pinky UNIX for Dummies Questions & Answers 6 09-19-2005 07:14 PM



All times are GMT -4. The time now is 03:48 PM.