News for hackers. Stuff that matters.
Re:look(1): lines beginning with given string by discardorama on Sunday December 13, 2015 @12:20AM (#10725498)
Binary search is useless unless the file is sorted. Most often my files are not sorted, so egrep '^line' works just fine.
Re:look(1): lines beginning with given string by alayne on Sunday December 13, 2015 @02:27AM (#10725691)
It 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?
Re:look(1): lines beginning with given string by mtdewcmu on Sunday December 13, 2015 @12:38AM (#10725524)
The 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.