Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am exec command:

yum info mcrypt | grep -i error > /dev/null
yum info mcrypt | grep -i error 2> /dev/null

But i see:

Error: No matching Packages to list

How I can hide this messasge from stdout?

share|improve this question

Its not exactly clear what you are trying to do - Why would you "grep" for an error message you don't want.

I suspect the problem you are having may be that you are diverting stderr after it has been displayed - you may want to be using

yum info mcrypt 2>/dev/null | grep -i "error"

Or, if you are simply wanting to ignore the error,

yum info mcryp3t 2>/dev/null
share|improve this answer
    
Thank you so mach. But it not what i want. i am using this expression to check avebility of yum package in my bash script. – Java Dude Sep 16 '13 at 18:11
    
$(yum info mcrypt | grep -i error) 2> /dev/null the same – Java Dude Sep 16 '13 at 18:12
1  
how about 'yum info mcrypt 2>&1 | grep "Name"' or 'yum info mcrypt 2>&1 | grep "Name" | wc -l' – davidgo Sep 16 '13 at 18:16
up vote -4 down vote accepted

nohup commands > /dev/null 2>&1 &

share|improve this answer
    
Please explain how this solves your problem. – mveroone Nov 26 '13 at 8:40
1  
How is this related to the question? Yes you used 2>&1 as davidgo suggested two months ago. -- Combined in >/dev/null 2>&1 it will discard both stdout and stderr. ...but how is the nohup and background execution & related? – pabouk Nov 26 '13 at 8:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .