[CentOS] broken behavior with `look`

Tue Jul 18 23:32:59 UTC 2006
Rodrigo Barbosa <rodrigob at darkover.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Jul 18, 2006 at 07:11:25PM -0400, Mike Hunter wrote:
> Hey everybody,
> 
> I'm having a strange problem with a hosted CentOS environment.  I like
> to use `look` to correct my spelling.  But it isn't willing to help me
> with the word "manager":
> 
> #>look man | wc -l                                                     
> 1001
> #>look mana | wc -l                                      
> 0
> #>grep "^mana" /usr/share/dict/words  | wc -l                           
> 54

#> look man | grep -B2 -A2 manager
managemental
managements
manager
manager's
managerdom
manageress
managerial
managerially
managers
managership
managery
manages
managing

> #>md5sum `which look`
> 05ef59ae2f9183e525ec531dcb07ee8b  /usr/bin/look
> #>cat /etc/redhat-release 
> CentOS release 4.3 (Final)
> #>uname -a
> Linux blahblah.com 2.6.8-022stab078.9-entnosplit #1 SMP Thu Jun 8 12:46:44 MSD 2006 i686 athlon i386 GNU/Linux

Virtuozzo VPS ?

> Can anybody confirm these results?  Any suggestions for a fix?

I can.

util-linux-2.12a-16.EL4.16

Some other interesting (d)effects:

#> look AngloCatholicism
Anglo-Catholicism

(Note: Both Anglo-Catholicism and AngloCatholicism are on the words file)

And now, for something entirely new:

#> look manager /usr/share/dict/words 
manager
manager's
managerdom
manageress
managerial
managerially
managers
managership
managery

Which leads me to the conclusion that is has nothing to do with the words
file, and it a but of the look utility itself.

Running strace, you can see that, in both cases, the exact same file is
opened:

#> strace look manager /usr/share/dict/words
(...)
open("/usr/share/dict/words", O_RDONLY|O_LARGEFILE) = 3
(...)

#> strace look manager
(...)
open("/usr/share/dict/words", O_RDONLY|O_LARGEFILE) = 3
(...)

Go figure.

[]s

- -- 
Rodrigo Barbosa
"Quid quid Latine dictum sit, altum viditur"
"Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEvW+rpdyWzQ5b5ckRAvJ0AKCBGNiJzbNYoEDt+ECCHd8Dlyt3JwCguQPi
AzbRow7Al22D9opREw5Npwg=
=+sUp
-----END PGP SIGNATURE-----