evan_tech

Previous Entry Share Next Entry
03:33 pm, 4 Nov 03

teach me something about unix

Can someone explain why this isn't doing what I expect? (This isn't a trick question; I'm honestly confused.)
~$ /usr/bin/mutt -v | head -1
Mutt 1.3.28i (2002-03-13)
~$ /home/martine/local/bin/mutt -v | head -1
Mutt 1.4.1i (2003-03-19)
~$ which mutt
/home/martine/local/bin/mutt
~$ mutt -v | head -1
Mutt 1.3.28i (2002-03-13)

Why is it running the old one?

For context:
~$ alias
alias ls='ls --color=auto'
~$ rehash
bash: rehash: command not found
~$ echo $PATH
/home/martine/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

And even weirder, if I try to strace it, it runs the right one. Eh?


Update: "rehash" is the csh/zsh command to rehash path lookups, while "hash" is the command used by bash (which I wasn't aware of).