[Haskell-cafe] confusion about cabal-install install

Roman Cheplyaka roma at ro-che.info
Sun May 11 13:58:57 UTC 2014


* Brandon Allbery <allbery.b at gmail.com> [2014-05-10 12:10:03-0400]
> On Sat, May 10, 2014 at 11:37 AM, Alexander Solla <alex.solla at gmail.com>wrote:
> 
> > But now consider:
> >
> >     $ cabal --version
> >
> >     cabal-install version 1.16.0.2
> >
> >     using version 1.16.0 of the Cabal library
> >
> >     $ which cabal
> >
> >     /home/ajs/.cabal/bin/cabal
> >
> >     $ /home/ajs/.cabal/bin/cabal --version
> >
> >     cabal-install version 1.20.0.1
> >
> >     using version 1.20.0.0 of the Cabal library
> >
> This is why I keep, completely pointlessly, telling people to never ever
> use `which`. It lies. But people want the lies and get confused when they
> prove to be lies.
> 
> Try `type cabal` --- NOT `which cabal` --- to see what is really going on.
> Then use `hash -r` to fix it.

This problem is specific to bash, I believe.

In zsh:

  % which which
  which: shell built-in command

While `type` is POSIX, the output of `which` (for external commands) is better
suited for use in command substitutions, so I mostly prefer it.

And once one is aware of the PATH caching, the problem above isn't hard to
recognize anyway.

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140511/f273247f/attachment.sig>


More information about the Haskell-Cafe mailing list