Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Do not display the command result in the console (updated)

by Crackers2 (Parson)
on Dec 06, 2013 at 01:43 UTC ( [id://1065877]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1065877]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-20 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found