Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by Crackers2 (Parson)
on Dec 06, 2013 at 01:43 UTC ( #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
Node Status?
node history
Node Type: note [id://1065877]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2020-10-26 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (250 votes). Check out past polls.

    Notices?