Wolfram Schneider d7c71d3534 grep -q pattern file
search 'pattern' in whole file 'file', from top to bottom.  This is
not necessary; if grep found 'pattern' it can stop further searching
in file 'file'.

Example:

$ time ./grep-old -q Adam /usr/share/dict/*
        1.93 real         1.05 user         0.85 sys
$ time ./grep-new -q Adam /usr/share/dict/*
        0.14 real         0.06 user         0.06 sys
1996-09-27 19:44:46 +00:00
..
1995-12-30 19:02:48 +00:00
1996-09-27 19:44:46 +00:00
1993-06-18 04:22:21 +00:00
1993-06-18 06:05:45 +00:00