confusion about cabal-install install

I'm trying to install cabal-install. I ran: $ cabal update && cabal install cabal-install After compiling, cabal reported: Installing executable(s) in /home/ajs/.cabal/bin Installed cabal-install-1.20.0.1 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 I am confused. My path is set to point to "$HOME/.cabal/bin/:$PATH"

On Sat, May 10, 2014 at 11:37 AM, Alexander Solla
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. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On May 10, 2014 9:10 AM, "Brandon Allbery"
On Sat, May 10, 2014 at 11:37 AM, Alexander Solla
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
wrote: prove to be lies.
Try `type cabal` --- NOT `which cabal` --- to see what is really going
on. Then use `hash -r` to fix it. Off-topic, but I just read a recounting of a guy recovering a system from a fork bomb, so he could only use shell builtins. And of course some sysadmin had aliased type to which, hanging the shell. So follow Brandon's advice, and don't alias type.

* Brandon Allbery
On Sat, May 10, 2014 at 11:37 AM, Alexander Solla
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

On Sun, May 11, 2014 at 9:58 AM, Roman Cheplyaka
This problem is specific to bash, I believe.
Yes, it's only specific to the shell that 99%+ of users use. I guess to you that means it's sufficiently irrelevant that you need to publicly dispute it? Seriously, don't make assumptions, get out of the habit of using something that may or may not work and don't spread those habits to people who don't know any better. "type" is specified by POSIX and required to show what the current shell will do. Use it. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Sun, May 11, 2014 at 10:08 AM, Brandon Allbery
On Sun, May 11, 2014 at 9:58 AM, Roman Cheplyaka
wrote: This problem is specific to bash, I believe.
Yes, it's only specific to the shell that 99%+ of users use.
Really? At least a third of the people I know use zsh. Not claiming to be a representative sample, but 99%+ sounds unrealistic. I was glad that Roman sent his reply, as it was directly useful for me.
I guess to you that means it's sufficiently irrelevant that you need to publicly dispute it?
Seriously, don't make assumptions, get out of the habit of using something that may or may not work and don't spread those habits to people who don't know any better. "type" is specified by POSIX and required to show what the current shell will do. Use it.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (5)
-
Alexander Solla
-
Brandon Allbery
-
John Lato
-
Nathan Bouscal
-
Roman Cheplyaka