Comment 6 for bug 1971425

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The same behavior can be seen in Ubuntu 23.04.

The look command requires a sorted file.
If no argument is given /usr/share/dict/words is used as default file and the f flag is set.
/usr/share/dict/words is sorted with upper case preceding lower case.
But when the f flag is set a sort ignoring case is assumed.

So the command look works as documented.

It is simply that the sort sequence of /usr/share/dict/words does not match what look needs.

You can create your own wordlist, sort it to your needs, and point environment variable WORDLIST to it.

$ cat /usr/share/dict/american-english | sort > foo
$ WORDLIST=foo look accicent
accident
accidental
accidentally
accidental's
accidentals
accident's
accidents

I would suggest not to change anything in util-linux.