Reputation: 11666
I've always been a little wobbly on OSX environment variables, but I figured that, so long as /usr/local/bin
was in my $PATH
, that everything residing in that folder would be usable as a command in the shell.
This doesn't appear to be happening. $ echo $PATH
gives me:
/Users/[username]/.nvm/versions/node/v0.12.7/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
My /usr/local/bin
folder contains a symlink to an application; let's call it some-application
. But typing some-application
in the shell yields the classic bash error:
-bash: some-application: command not found
Upvotes: 2
Views: 1055
Reputation: 11666
It was a simple mistake on my part. I had created the symlink using a bad link location:
$ ln -s /some/non-existent/location/some-application /usr/local/bin/some-application
There was no error on creating this 'link'. The symlink name was the one used in the bash error, masking the fact that it couldn't find the original location, not the link.
For me, I would have either expected an error to be thrown on creation of the link, or at least for bash to detail which path couldn't be resolved. Something like this:
-bash: /some/non-existent/location/some-application: No such file or directory
Oh well. Case closed.
P.S
Any light being shed on why it behaves this way might be helpful to myself and others.
Upvotes: 2