1

I edited /etc/paths, putting the local directories on top, and now I cannot run commands in terminal, including sudo, and am afraid this will affect the system outside terminal.

Trying to solve it, I have commented out everything and sourced .bash_profile and .bashrc, there is nothing under /etc/paths.d/, and /etc/paths is now:

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

Yet the problem remains:

$ echo $PATH
/Volumes/Macintosh HD/Users/jsmm/.wp-cli/bin:/usr/local/bin:/Volumes/Macintosh HD/Users/jsmm/bin:/Volumes/Macintosh HD/Users/jsmm/.wp-cli/bin:/usr/local/bin:/usr/local/sbin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/mysql/bin:/Volumes/Macintosh:/Volumes/Macintosh:/Volumes/Macintosh HD/Users/jsmm/.wp-cli/bin

And:

$ /usr/libexec/path_helper -s
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/Volumes/Macintosh HD/Users/jsmm/.wp-cli/bin:/Volumes/Macintosh HD/Users/jsmm/bin:/usr/local/sbin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/mysql/bin:/Volumes/Macintosh"; export PATH;

System is Mac OS X 10.8 Mountain Lion. Looking forward to your help,

jmm
  • 11
  • 4
  • Can you run terminal commands using their full path names, e.g. `/usr/bin/sudo` – Digital Trauma Sep 27 '13 at 15:22
  • In my /etc/paths.d I have `/etc/paths.d/40-XQuartz`. This just a one-line text file containing `/opt/X11/bin` – Digital Trauma Sep 27 '13 at 15:23
  • After returning the edited files/directories back to their previous state, I would imagine a full reboot would get you back to normal. Have you tried this? – Digital Trauma Sep 27 '13 at 15:24
  • Thanks. Under that path I only have /etc/paths.d/TeX. Should I have that X11? Yes, I can run apps with full path names. And, well, the behavior came along without rebooting so I am also hoping to revert it without. I risk not being able to log in. – jmm Sep 27 '13 at 15:29
  • In /etc/profile there is: # 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 – jmm Sep 27 '13 at 15:39
  • $ source .bash_profile, the result is: -bash: /Volumes/Macintosh: line 1: syntax error near unexpected token `newline' -bash: /Volumes/Macintosh: line 1: `' – jmm Sep 27 '13 at 16:06
  • Most likely the X11 entry is only necessary if you running X11 apps (wireshark and xterm (not terminal) are examples I can think of). Otherwise it is probably not a big deal – Digital Trauma Sep 27 '13 at 17:42
  • My /etc/profile is identical (assuming the SO comment box ate your newlines) – Digital Trauma Sep 27 '13 at 17:43
  • Can you provide line 1 of your .bash_profile? – Digital Trauma Sep 27 '13 at 17:46
  • Here are lines 1 and 2: PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH" # Make sure to use double quotes not single quotes And on a new line || export PATH – jmm Sep 27 '13 at 18:35
  • Somehow it updated to the new settings after a while and I think it is back to normal now. Thanks for your help. – jmm Sep 27 '13 at 18:40
  • I still wonder if this output from 'echo $PATH' is healthy: ~/.wp-cli/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/.wp-cli/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/Volumes/Macintosh HD/Users/jsmm/.rvm/bin – jmm Sep 27 '13 at 18:41

0 Answers0