You are not logged in.
In the process of getting some things (Skype and Maven) to run I've managed to get some directories to appear twice when I echo $PATH. Is there a single file that I can edit to as to keep this list tidy and readily accessible?
Offline
Try looking in /etc/profile and /etc/profile.d
The basic pathing is called from /etc/profile and within that script it calls any path scripts located in /etc/profile.d/
Last edited by shen (2007-05-09 03:26:30)
Offline
or try your .${shell}rc file.
ie. ~/.bashrc or ~/.zshrc.
perhaps your ~/.bash_profile will have it, aswell.
Offline
I think the tidiest approach is to set PATH's on a per-user basis in ~/.bashrc. Using .bashrc means that $PATH is set for both login and interactive shells since the default .bash_profile reads in .bashrc. Something like export PATH="$PATH:/new/path". For new system-wide path's set them in /etc/profile by appending to the line that's already in there.
Offline
I agree if you want to add any custom PATH then do it in .bashrc in your home directory. If you want to see any current system PATH variables look in the areas I posted above.
Offline
Thanks for the answers. Nevertheless, there are more things about which I am curious. For example, if I enter "export PATH = $PATH:/some/new/path" on the command line, is that written into my .bashrc?
Offline
Thanks for the answers. Nevertheless, there are more things about which I am curious. For example, if I enter "export PATH = $PATH:/some/new/path" on the command line, is that written into my .bashrc?
Your path is in a system variable named PATH. By convention, variable names are in all capital letters. To access this variable in bash, you put a $ in front of the variable name, in this case $PATH. The command
export PATH = $PATH:/some/new/path"
entered on the command line appends /some/new/path to the system variable named PATH. It does not change .bashrc in any way. In fact, if you want your new PATH set everytime you enter bash, put the
export PATH=$PATH:/some/new/path
in your .bashrc file, and it will be executed every time you start bash and be there automatically for you.
For further info on this, look at the man page for bash
$ man bash
Shell Variables
The following variables are set by the shell:HOME The home directory of the current user; the default argument for
the cd builtin command. The value of this variable is also used
when performing tilde expansion.PATH The search path for commands. It is a colon-separated list of
directories in which the shell looks for commands (see COMMAND
EXECUTION below). A zero-length (null) directory name in the
value of PATH indicates the current directory. A null directory
name may appear as two adjacent colons, or as an initial or
trailing colon. The default path is system-dependent, and is
set by the administrator who installs bash. A common value is
``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin''.
as a couple of examples.
Pudge
Last edited by Pudge (2007-05-10 01:55:16)
Offline
Thanks for the answers. Nevertheless, there are more things about which I am curious. For example, if I enter "export PATH = $PATH:/some/new/path" on the command line, is that written into my .bashrc?
No, that will only set your $PATH variable for that window. As soon as you close the window (assuming it's a terminal running in X) the change will be gone.
Offline