http://qs321.pair.com?node_id=1065877


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

    Hi Crackers2,

    sorry about the mistake, the one in the code I'd like to run is correct, I checked. I'm correcting myself in the question. Also, the command does not output anything in the standard error output for now. So I don't understand why i still have the display.