in reply to Re: grepping a large file and stopping on first match to a list
in thread grepping a large file and stopping on first match to a list

The example supports many options.

egrep.pl --help Options for Many-Core Engine: --max-workers=NUM override max workers (default auto) e.g. auto, auto-2, 4 --chunk-size=NUM[KM] override chunk size (default 4M) minimum: 200K; maximum: 20M Usage: egrep.pl [OPTION]... PATTERN [FILE] ... Search for PATTERN in each FILE or standard input. Example: egrep.pl -i 'hello world' menu.h main.c Regexp selection and interpretation: -e, --regexp=PATTERN use PATTERN as a regular expression -i, --ignore-case ignore case distinctions Miscellaneous: -s, --no-messages suppress error messages -v, --invert-match select non-matching lines --help display this help and exit Output control: -m, --max-count=NUM stop after NUM matches -n, --line-number print line number with output lines -H, --with-filename print the filename for each match -h, --no-filename suppress the prefixing filename on output -q, --quiet, --silent suppress all normal output -R, -r, --recursive equivalent to --directories=recurse --include=PATTERN files that match PATTERN will be examined --exclude=PATTERN files that match PATTERN will be skipped --exclude-from=FILE files that match PATTERN in FILE will be s +kipped --exclude-dir=PATTERN directories that match PATTERN will be ski +pped requires a recent egrep binary for --exclu +de-dir -L, --files-without-match only print FILE names containing no match -l, --files-with-matches only print FILE names containing matches -c, --count only print a count of matching lines per F +ILE With no FILE, or when FILE is -, read standard input. If less than two FILEs given, assume -h. Exit status is 0 if match, 1 if no match, and 2 if trouble.