in reply to Do not display the command result in the console (updated)
One issue is that your redirections are in the wrong order
$ ( echo "out"; echo "err" >&2 ) 2>&1 1>/dev/null err $ ( echo "out"; echo "err" >&2 ) 1>/dev/null 2>&1 $
The first one, like you have, ends up redirecting stdout to /dev/null, but stderr to the original stdout. The second one redirects stdout to /dev/null, and then stderr to the new stdout, i.e. also /dev/null
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Do not display the command result in the console (updated)
by young_monk_love_perl (Novice) on Dec 06, 2013 at 09:17 UTC |
In Section
Seekers of Perl Wisdom