grep, etc

Bob Stockler bob at trebor.iglou.com
Wed Aug 18 09:17:32 PDT 2004


On Wed, Aug 18, 2004 at 11:07:34AM -0400, Bob Stockler wrote:
| 
| I would guess that "mawk" would be faster than "grep" in certain
| circumstances, especially when searching a large file, because
| it could be made to exit after reading the lines to be matched.

Example:

  [trebor] ~bob: time grep '^factory$' /usr/dict/words
  factory

  real    0m0.11s
  user    0m0.06s
  sys     0m0.01s
  [trebor] ~bob: time mawk '/^factory$/{print;exit}' /usr/dict/words
  factory

  real    0m0.06s
  user    0m0.01s
  sys     0m0.00s

Bob

-- 
Bob Stockler - bob at trebor.iglou.com
Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
Fully functional (time-limited) demos available by email request (specify OS).


More information about the Filepro-list mailing list