Subject: Re: redirection within sh-like shells
To: None <email@example.com>
From: David Laight <firstname.lastname@example.org>
Date: 08/15/2002 16:17:59
On Thu, Aug 15, 2002 at 05:00:21PM +0200, Aymeric Vincent wrote:
> Jan Schaumann <email@example.com> writes:
> > Klaus Heinz <firstname.lastname@example.org> wrote:
> > > $ sh
> > > $ bla >/dev/null 2>&1
> > > bla: not found
> > Given my understanding of shells and redirection, I can not comprehend
> > why 'sh' does _not_ print the error to /dev/null. It has been
> > instructed to do so.
> Actually, the shell has been instructed to redirect the output of the
> "bla" command to /dev/null. Not its own output.
> So it seems semantically correct to me.
The pertintent section of xcu is:
Command search and execution:
ii. If the search is unsuccessful, the command shall fail with
an exit status of 127 and the shell shall write an error message.
Note that the command fails first, the error is written after.
Also the redirections are done 'in the execution environment of the command'.
David Laight: email@example.com