3 ms·
Binary search is useless unless the file is sorted. Most often my files are not sorted, so egrep '^line' works just fine.
by discardorama 11y ago
Binary search is useless unless the file is sorted. Most often my files are not sorted, so egrep '^line' works just fine.
- mtdewcmu 11y agoThe interesting use case for me is that you can make a sorted index and look up records efficiently, i.e. within a script. It works with ctags indexes, for instance.
- alayne 11y agoIt obvious that look was written as an optimization for this specific case though. The default file is the user dictionary which is interesting. Do you think they didn't know about grep in 1979?