PDA

View Full Version : Grep help


DaMasta
January 1st, 2006, 05:27 AM
Writing a shell script. Need some grep help.
I wanted to see if had I an ices stream running. I ran ps -ef | grep ices. It found the ices stream as well as something with the word services in it. What can I do to only get the ices stream?

kabus
January 1st, 2006, 05:57 AM
Try grep -w to match only whole words.

ape
January 1st, 2006, 06:00 AM
try `ps -ef | grep -E "\bices\b"`

DaMasta
January 1st, 2006, 06:26 AM
Awesome guys, thanks.