Java Mailing List Archive

http://www.redhatconfig.com/

Home » Red Hat Enterprise Linux 5 »

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

Edward F. Brown

2007-12-31

Replies:

Author LoginPost Reply
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
rhelv5-list@(protected)
https://www.redhat.com/mailman/listinfo/rhelv5-list
©2008 redhatconfig.com - Jax Systems, LLC, U.S.A.