Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Minor improvement' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Minor improvement
Authored by: rohanl on Dec 15, '04 04:09:41AM
You can remove the need for the second grep by using a common trick. If you place a single character of your pattern in [] it makes no change to the matching, but will no longer match against itself. eg. change:

NEEDNEWPBS=`ps x | grep /System/Library/CoreServices/pbs | grep -v grep ; echo $?`
to:

NEEDNEWPBS=`ps x | grep "/System/Library/CoreServices/pb[s]" ; echo $?`


[ Reply to This | # ]