It sounds to me as if /etc/profile
wasn't run at shell startup. It's the global startup file responsible for initializing PATH. Check whether /etc/profile
exists and is readable and executable with the following command:
. /etc/profile
If it isn't there, you'll need to restore it from a backup or another machine with Lion installed, or install Lion again. If it exists but isn't executable, try using Disk Utility to Repair Disk Permissions.
If it does exist and is executable (and it contains some code), either it may not be getting run when it's supposed to or your startup script may somehow be overriding it. As a workaround, try putting . /etc/profile
at the start of your ~/.bash_profile
to ensure it is run. If you still encounter the problem, add echo $PATH
after running it to see if PATH was initialized properly. If it was, something in your script is changing it.
Here's the default contents of /etc/profile
:
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
path_helper
constructs the default PATH. You could try running
unset PATH; /usr/libexec/path_helper -s
to see what it produces.
In any case, if the problem isn't in your startup script(s), please contact Apple support http://www.apple.com/support/contact/ or report a bug at https://bugreport.apple.com/ to let Apple know there's a problem.
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
paste the dark part (or type it VERY CAREFULLY) - since two commands are missing - something whacked your path. Before doing anything big, kicking off a backup might be prudent./usr/bin/vi ~/.bash_profile
Put that as an answer and I can accept!