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
..
1996-09-22 00:55:46 +00:00
1995-05-30 05:05:38 +00:00
1996-09-10 13:23:46 +00:00
1996-09-23 16:12:38 +00:00
1996-08-15 22:11:36 +00:00
1995-12-30 19:02:48 +00:00
1996-08-20 14:22:57 +00:00
1996-09-10 14:03:12 +00:00
1996-09-27 19:44:46 +00:00
1996-08-28 15:45:32 +00:00
1996-09-23 22:24:39 +00:00
1996-03-01 15:18:55 +00:00
1993-11-12 07:05:40 +00:00
1996-09-10 14:04:37 +00:00