If it restarted every few hours and the test executed once a minute, then the bug would appear only once in a hundred executions. It's a good post, I think I could have made the same mistake easily.
I'd never noticed it. I worked in a unix shell for a while, but I used to use ps piped to grep. But I suspect I often used 'grep -v' to filter the output anyway when I really needed just the non-grep lines.
Anyone who's ever done 'ps | grep' will have noticed that the grep sometimes appears, sometimes doesn't.
Course you could do 'ps | grep | grep -v grep'