How do I set the $PATH environment variable?
I think I'm missing something. This shouldn't be this hard. I'm very frustrated over something that should be simple. Any assistance is appreciated.
Mac OS X (10.6.2)
Mac OS X (10.6.2)
~/Desktop/name-of-your-script
... I think at one point I got it to say "Permission Denied",
chmod +x ~/Desktop/name-of-your-script
and then I tried the same command with sudo behind it, I got a "command not found" error.
sudo: abc: command not found
Jon R wrote:
All I want to do is to be able to run shell scripts, that are located on my desktop, in terminal.
Of course, the $PATH environment variable has to be changed in order to do that.
I've tried editing etc/paths via the root account.
I've tried creating a .bash_profile in my home folder. Neither works. I think at one point I got it to say "Permission Denied", and then I tried the same command with sudo behind it, I got a "command not found" error. Furthermore, when I type env in terminal to see what the current path is, the last path(there are multiple paths in the PATH variable) is nowhere to be found in the etc/paths file. The rest of the PATH variable is in etc/paths, but the last one isn't.
When I last edited etc/paths by just pasting the appropriate path on a new last line in the file, when I typed env in terminal, it add stuff that I didn't type. Like I pasted Users/Me/Desktop in etc/paths, and when I typed env, that part part of PATH said Users/Me/Desktop/sbin:sbin. Oh, and if it's of any help, if I just type $PATH in terminal, I get a 'no such directory' error.
# My custom path.
export PATH="~/Desktop/sbin:$PATH"
Add to .bash_profile:
PATH=$PATH:~/Desktop
export PATH
To see the path, type echo $PATH
export PATH="$PATH:$HOME/Desktop"
export PATH="$PATH:$HOME/Desktop/sbin"
... if I just type $PATH in terminal, I get a 'no such directory' error.
echo $PATH
How do I set the $PATH environment variable?