Subject: Re: redirection within sh-like shells
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Greg A. Woods <firstname.lastname@example.org>
Date: 08/15/2002 13:24:52
[ On , August 15, 2002 at 17:00:21 (+0200), Aymeric Vincent wrote: ]
> Subject: Re: redirection within sh-like shells
> 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.
Ah ha! Yes, that's the logic I was trying to come up with in my head.
ksh et al are indeed wrong -- I just couldn't put the reason into words!
though I was getting close with this example:
$ sh -c 'blah > /dev/null 2>&1'
blah: not found
which seemed much closer to illustrating what was going on....
Greg A. Woods
+1 416 218-0098; <email@example.com>; <firstname.lastname@example.org>
Planix, Inc. <email@example.com>; VE3TCP; Secrets of the Weird <firstname.lastname@example.org>