I was trying to set up a bash command in Terminal on a Mac.
The scripts run correctly when I execute them directly.
I set up symlinks in /usr/local/bin/ to the current location of the scripts. When I try to run it off the symlink, it doesn’t work. I don’t believe the issue is the $PATH, because pip, git, ipython all exist in this location. When I edit the $PATH setting, these fail.
Suggestions?
ls -l /usr/local/bin/fooand see where your symlink is actually pointing. Betcha it’s broken.If not, try running
/usr/local/bin/foo. If that works, it was your PATH that’s wrong, despite what you said in the OP.The only other thing that would cause this behavior is if the script is reading
$0(its own name as executed). With a symlink, that will have a different value.