Here's a simple Unix tip, inspired by a comment Rob made on a recent hint:
...When I ran ps ax | grep Dash ... (OK, technically, it found the grep, but that's because I'm too lazy to add it as an ignored match)...You can use a simple regular expression, instead of adding another grep -v pipe element, to ignore the self-match when grep-ing for a literal string. That is, rather than this:
ps ax | grep Dash | grep -v grep
Use this:
ps ax | grep [D]ash
The regular expression (the D inside the square brackets) matches a character set which contains a single character (upper case D in this case) and the literal string "ash." So this grep can't self-match the original regular expression string, as it also includes the square brackets.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050729121017774