iv0 <[EMAIL PROTECTED]> writes:
> 1) you dump the output: 2>&1 > /dev/null
In the interest of random correction... this is a common shell output
redirection mistake. The above does not send stdout and stderr to
/dev/null; it sends stdout to /dev/null and stderr to wherever stdout was
going before it was redirected.
The reason why is that redirections are parsed from left to right, and
2>&1 *dups* file descriptor 1 and sends 2 there. So later changes to the
disposition of file descriptor 1 have no effect on 2.
Observe:
$ echo "this goes to stderr" >&2
this goes to stderr
$ ( echo "this goes to stderr" >&2 ) > /dev/null 2>&1
$ ( echo "this goes to stderr" >&2 ) 2>&1 > /dev/null
this goes to stderr
Order is significant in Bourne shell I/O redirection.
--
Russ Allbery ([EMAIL PROTECTED]) <http://www.eyrie.org/~eagle/>