On Mon, December 31, 2007 12:28 pm, Collins, Kevin [MindWorks] wrote:
> It would NOT behave the same. The stderr is not sent thru the pipe
> without that redirection. See below:
You, and the OP's script, are quite right. The man page says it this way:
-----------------
Note that the order of redirections is significant. For example, the command
ls > dirlist 2>&1
directs both standard output (file descriptor 1) and standard error (file
descriptor 2) to the file dirlist, while the command
ls 2>&1 > dirlist
directs only the standard output to file dirlist, because the standard
error was duplicated as standard output before the standard output was
redirected to dirlist.
-------------------
Thanks for the elegant proof.
-Ed
_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list