NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/52687: can't suppress warnings from /bin/sh
On Nov 1, 12:15pm, coypu%sdf.org@localhost (coypu%sdf.org@localhost) wrote:
-- Subject: Re: bin/52687: can't suppress warnings from /bin/sh
| I was hinted at this, which works:
| (nonexistent) 2>/dev/null
|
| And I am redirecting nonexistent's stderr.
This is by design;
nonexistent 2> /dev/null
Means redirect file descriptor 2 of the child process. The shell
tries to execute the child process (after redirection is done),
fails and prints the error message. You need to redirect fd 2 of
the shell. To do this you either need to capture fd 2 of another
shell (the subshell solution above) or:
$ exec 3>&2 2> /dev/null
nonexistent
exec 2>&3
$
christos
Home |
Main Index |
Thread Index |
Old Index