Subject: Re: redirection within sh-like shells
To: None <firstname.lastname@example.org>
From: David Laight <email@example.com>
Date: 08/15/2002 16:17:59
On Thu, Aug 15, 2002 at 05:00:21PM +0200, Aymeric Vincent wrote:
> Jan Schaumann <firstname.lastname@example.org> writes:
> > Klaus Heinz <email@example.com> 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: firstname.lastname@example.org