1
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?
1
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?
-4
nohup commands > /dev/null 2>&1 &
3
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
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 – 2013-09-16T18:11:02.403
$(yum info mcrypt | grep -i error) 2> /dev/null the same – Java Dude – 2013-09-16T18:12:48.350
1how about 'yum info mcrypt 2>&1 | grep "Name"' or 'yum info mcrypt 2>&1 | grep "Name" | wc -l' – davidgo – 2013-09-16T18:16:51.527
Please explain how this solves your problem. – mveroone – 2013-11-26T08:40:15.587
1How 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 thenohup
and background execution&
related? – pabouk – 2013-11-26T08:43:33.143