I'm writing a script in solaris 9, and need to test the standard out of a grep operation to see if it finds anything. Any ideas? Here's the code i have:
onstat -u|grep "Y--P"|awk '{print $1,$2,$3}'
I want to put it in an if statement like this:
If
grep returns something
then
else
exit
fi
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.