Somehow I can’t execute files in /bin
or /usr/bin
without providing the full path.
This isn’t happening when running from Terminal, but, for example, iTerm can’t run bash
(only /bin/bash
), OnyX can't run sw_vers
.
.profile: export PATH=/opt/local/bin:/opt/local/sbin:/bin:/usr/bin:$PATH
.profile: export PATH=$PATH
.bash_history: export PATH="$PATH:"'/Users/gilstrauss/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin'
.bash_history: export PATH=/opt/local/bin:/opt/local/sbin:$PATH
.bash_history: export PATH=${PATH}:/bin
.bash_profile: export PATH=/bin:$PATH
.bashrc: export PATH=${PATH}:/bin:/usr/bin
Best Answer
Terminal.app correctly starting the shell does’t mean much: it runs
/usr/bin/login
(with the full path) by default, which invokes your default shell (again: defined with a full path) as an interactive login shell (which will in turn read both.profile
and.bashrc
and leave you with a working$PATH
). Your problem is non-interactive shells, which do neither, do not get any$PATH
settings. That seems to point to OS X’ default path settings having somehow been clobbered.To check this, run
cat /etc/paths
. The output should (at the very least) be(these are the defaults on a pristine OS X install). If the first two are missing, you have your cause – and an easy solution:
Note that as
/etc/paths
is owned byroot
, you will have tosudo su
for this to work.