I've been very frustrated at repeatedly finding this answer to this question, which is in fact completely unhelpful.
Using -v will return 0 for any file that contains lines that don't contain the search pattern, which is generally true, and therefore generally useless!
The 'real' answer IMHO is that you need to do this using your OS/shell to reverse the return code. On Win32 >Win2k you can use this:
cmd /c "grep pattern...
Leave a comment: