appending both stderr and stdout to a single file

Dave Ihnat ignatz at dminet.com
Thu Mar 8 14:30:01 UTC 2007


On Thu, Mar 08, 2007 at 04:55:17PM +0530, Marq wrote:
> ls >> dirlist 2>>&1
> 
> this will redirect stdout first and then the stderr
> 
> but i need to redirect the both output as it appear in the screen (with out
> redirection)

When you do "2>&1", all that happens is the file descriptor for stderr is
reassigned to the same descriptor as stdout--there won't be any "stdout
first, then stderr".  Yes, some strange things can sometimes happen if
you do pipelining, but not from a single command.
--
	Dave Ihnat
	ignatz at dminet.com




More information about the redhat-list mailing list