[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: [rhelv5-list] Regular Expressions on RHEL 5



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]