Subject: Re: redirection within sh-like shells
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Greg A. Woods <email@example.com>
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 <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.
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; <firstname.lastname@example.org>; <email@example.com>
Planix, Inc. <firstname.lastname@example.org>; VE3TCP; Secrets of the Weird <email@example.com>