-
All replies
-
Helpful answers
-
May 1, 2016 6:57 AM in response to mahdimormiby BobHarris,You messed up your PATH environment variable.
/bin/ls
works because you did not need PATH to find the 'ls' program. You can run ANY command by specifying its full path.
You need to re-edit your .bash_profile to either remove your PATH, or fix it. I do not know what editor you used to modify .bash_profile to begin with, but you can use
/usr/bin/nano
/usr/bin/vi (ONLY if you know vi/Vim)
/usr/bin/vim (ONLY if you know vi/Vim)
/usr/bin/emacs (I shutter to think about this)
TextWrangler (a very good free GUI text editor) <http://www.barebones.com/products/textwrangler/>
Or you can just rename the current .bash_profile and start a new terminal session, then fix the renamed .bash_profile before putting it back in service
/bin/mv .bash_profile saved.bash_profile
-
May 1, 2016 7:03 AM in response to mahdimormiby BobHarris,And while your echo $PATH kind of looked OK, it will not show any spaces or non-printing characters that go into the environment variable. Please use the following command and post the results
echo "@@@${PATH}@@@" | cat -vte
The @@@ will make sure we see any white space between the @ and the first/last character in $PATH
The cat -vte will convert any non-printing characters into notation such as a tab will display as ^I and the very last character will be a $ since echo adds a newline to the output, and cat -vte will display $ for that echo added newline.
That will show us a clear picture of what your PATH environment variable looks like.