Re: How Do I edit $PATH in Suse 10.1
- From: ibuprofin@xxxxxxxxxxxxxxxxxxxxxx (Moe Trin)
- Date: Fri, 16 Feb 2007 20:57:46 -0600
On 15 Feb 2007, in the Usenet newsgroup alt.os.linux.suse, in article
<1171568903.179020.7540@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, johnny wrote:
I was able to edit /etc/profile and change the order of /usr/local/bin
and /usr/bin. And for the "root" user, I changed the .bashrc to set
an alias for 'python' to point to /usr/bin rather than /usr/local/
bin. For the user "myself", I tried setting alias "python" in
the .bashrc to /usr/bin (this where Python version 2.4). But when I
do "python -V", I get version 2.5. Which is in /usr/local/bin.
Is there some specific reason that you need two versions of Python?
How do I edit the $PATH so it will go to /usr/bin for user "myself".
Also, I need to delete the repeated paths that I set using EXPORT.
Export just appended the same path over and over again. Thank you.
ps -afuwx
and determine what process is your login process. This should be the
first process with your username. If you are using a command line
login (runlevel 3), this is probably /bin/bash. For that, /etc/profile
is where "everyone" is set, and individuals are set AFTERWARDS by the
settings in ~/.bash_profile in the individual user's directory. Note
that if you use 'su' to become root rather than logging in, you need
to use 'su -' or 'su -l' to obtain root's environment in place of the
user you were.
If your login process is not the command line (runlevel 3), OR if you
are logging in via SSH or some network process, then you MAY not be
running a bash login shell, which means that /etc/profile and
~/.bash_profile are ignored. See the man page for your login process.
For a GUI (runlevel 5), this is probable your X display manager, such
as 'xdm' or 'gdm' or even 'kdm'. See that man page, because they have
their own warts and do things in strange ways. Also if you are not
using /bin/bash as your shell, but something else (ash, csh, zsh, or
any of the other shells found in /etc/shells), see the man page for
that shell paying close attention to files and login processes.
There are two basic ways to set a PATH. The first is to set the PATH
absolutely - as in "PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin".
You can _also_ use a 'prepend' or 'append' method to _ADD_ to the
existing PATH - as in "PATH=$PATH:$HOME/bin" which would add the
bin directory in the user's home directory to the end of the PATH.
The problem doing it this way is that you need to be sure to use the
correct file - one that is only run _once_ at login (such as
~/.bash_profile) and not one that is run every time a shell starts
(such as ~/.bashrc). Otherwise, you get the runaway path problem you
mention.
Old guy
.
- References:
- How Do I edit $PATH in Suse 10.1
- From: johnny
- How Do I edit $PATH in Suse 10.1
- Prev by Date: Re: CRT monitor fresh rate
- Next by Date: Newb broke his X real dumb!
- Previous by thread: Re: How Do I edit $PATH in Suse 10.1
- Next by thread: Nvidia 8800 driver install on openSuSE 10.2 issue
- Index(es):
Relevant Pages
|
|