[comp.unix.xenix] look

rac@sherpa.uucp (Roger Cornelius) (11/21/89)

I noticed today that the look(CT) command has some problems.
Try "look ??" where "??" is any two characters which might begin
a word.  None of the examples I tried found anything.  Adding a file
name to the end caused it to find some of the matching words, but
not all.  I assume this is because the default -df flags are disabled
when a filename is specified.  Try "look sa /usr/dict/words" to repeat.

If you examine /usr/dict/words, you'll see that the words look found (in
the "look sa /usr/dict/words" example) are delimited by uppercase words,
i.e., the word before the first word found, and the word after the last
word found both begin with uppercase characters.  But there are other
words beginning with "sa" (uc and lc) both before and after the found
words.  Using the -f (fold uc to lc) flag prints all matching words as
would be expected.

This appears to be caused partly by /usr/dict/words being sorted without
regard to case.  Re-sorting it and then using look will find all
occurrances, but only if the dictionary-file is specified on the command
line.

Can anyone who has seen the look source explain the behavior?