Subject: Re: redirection within sh-like shells
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Aymeric Vincent <Aymeric.Vincent@labri.fr>
List: tech-userlevel
Date: 08/15/2002 18:39:25
der Mouse <mouse@Rodents.Montreal.QC.CA> writes:

> Redirecting the failure message to /dev/null is both arguably more
> useful (otherwise there's no way to shut off failure messages like that
> in shell scripts)

It is not more useful if you wonder why a shell script doesn't work,
just because it actually can't find a given command. Plus you can
always ask a subshell to do the job, with its output redirected
wherever you want:

$ bla 2>/dev/null
bla: not found
$ (bla) 2>/dev/null
$ 

> and more consistent (failure messages generated by the executed
> program *are* redirected by such a construct).

It is not more consistent; the reasons of the failures are different,
so it does not look inconsistent to me that the shell behaves
differently.

 Aymeric