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
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