PATH environment variable for root is wrong - Aix
This is a discussion on PATH environment variable for root is wrong - Aix ; I want to set my PATH environment variable to /usr/bin:/etc:/usr/sbin:/
usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:
/usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
Therefore I modified the /etc/environment file to this:
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/
jre/bin:
/usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
Then I logoff and login again as root:
# echo $PATH
/usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin:/usr/bin:/etc:/usr/
sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:/usr/java6_64/
bin:/usr/local/bin:/usr/opt/ifor/bin:/usr/local/bin
This is wrong.
...
-
PATH environment variable for root is wrong
I want to set my PATH environment variable to /usr/bin:/etc:/usr/sbin:/
usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:
/usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
Therefore I modified the /etc/environment file to this:
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/
jre/bin:
/usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
Then I logoff and login again as root:
# echo $PATH
/usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin:/usr/bin:/etc:/usr/
sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:/usr/java6_64/
bin:/usr/local/bin:/usr/opt/ifor/bin:/usr/local/bin
This is wrong.
Why /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin at the start of
the PATH environment variable?
My computer is aix 5.3.
-
Re: PATH environment variable for root is wrong
On Sep 10, 11:46 pm, TsanChung wrote:
> I want to set my PATH environment variable to /usr/bin:/etc:/usr/sbin:/
> usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:
> /usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
>
> Therefore I modified the /etc/environment file to this:
> PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/
> jre/bin:
> /usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
>
> Then I logoff and login again as root:
> # echo $PATH
> /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin:/usr/bin:/etc:/usr/
> sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:/usr/java6_64/
> bin:/usr/local/bin:/usr/opt/ifor/bin:/usr/local/bin
>
> This is wrong.
Its not wrong. Its just something you did not expect.
> Why /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin at the start of
> the PATH environment variable?
You should read
http://publib.boulder.ibm.com/infoce...rtup_files.htm
Short: ( In case you did not changed the default shell or switching to
a different shell during login )
/etc/environment
/etc/profile
~/.profile
~/.env
~/.kshrc
enjoy and good night
Hajo
-
Re: PATH environment variable for root is wrong
On Sep 10, 6:19*pm, Hajo Ehlers wrote:
> On Sep 10, 11:46 pm, TsanChung wrote:
>
> > I want to set my PATH environment variable to /usr/bin:/etc:/usr/sbin:/
> > usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:
> > /usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
>
> > Therefore I modified the /etc/environment file to this:
> > PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/
> > jre/bin:
> > /usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
>
> > Then I logoff and login again as root:
> > # echo $PATH
> > /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin:/usr/bin:/etc:/usr/
> > sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:/usr/java6_64/
> > bin:/usr/local/bin:/usr/opt/ifor/bin:/usr/local/bin
>
> > This is wrong.
>
> Its not wrong. Its just something you did not expect.
>
> > Why /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin at the start of
> > the PATH environment variable?
>
> You should readhttp://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.a...
>
> Short: ( In case you did not changed the default shell or switching to
> a different shell during login )
> /etc/environment
> /etc/profile
> ~/.profile
> ~/.env
> ~/.kshrc
>
> enjoy and good night
> Hajo
I had read
http://publib.boulder.ibm.com/infoce...opic/com.ibm.a...
I double checked that PATH is defined only in
/etc/environment
but not defined in any of the following files for the root user:
/etc/profile
~/.profile
~/.env
~/.kshrc
but still cannot solve my problem.
I even reboot my aix computer.
However, the current PATH for root is still not the same as the PATH
in /etc/environment.
-
Re: PATH environment variable for root is wrong
On Sep 11, 3:15 pm, TsanChung wrote:
> On Sep 10, 6:19 pm, Hajo Ehlers wrote:
>
>
>
> > On Sep 10, 11:46 pm, TsanChung wrote:
>
> > > I want to set my PATH environment variable to /usr/bin:/etc:/usr/sbin:/
> > > usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:
> > > /usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
>
> > > Therefore I modified the /etc/environment file to this:
> > > PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/
> > > jre/bin:
> > > /usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
>
> > > Then I logoff and login again as root:
> > > # echo $PATH
> > > /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin:/usr/bin:/etc:/usr/
> > > sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:/usr/java6_64/
> > > bin:/usr/local/bin:/usr/opt/ifor/bin:/usr/local/bin
>
> > > This is wrong.
>
> > Its not wrong. Its just something you did not expect.
>
> > > Why /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin at the start of
> > > the PATH environment variable?
>
> > You should readhttp://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.a...
>
> > Short: ( In case you did not changed the default shell or switching to
> > a different shell during login )
> > /etc/environment
> > /etc/profile
> > ~/.profile
> > ~/.env
> > ~/.kshrc
>
> > enjoy and good night
> > Hajo
>
> I had readhttp://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.a...
> I double checked that PATH is defined only in
> /etc/environment
> but not defined in any of the following files for the root user:
> /etc/profile
> ~/.profile
> ~/.env
> ~/.kshrc
> but still cannot solve my problem.
> I even reboot my aix computer.
> However, the current PATH for root is still not the same as the PATH
> in /etc/environment.
Which tool is used to login ?
Supply the output from
$ ps
$ cat ~/.profile
$ cat $ENV
$ ls -A ~ | grep "^\." | xargs -n1 -I{} grep -n PATH /dev/null {}
$ find ~/.ssh /etc/ssh/ -type file | xargs -n1 -I{} grep -n PATH /
dev/null {}
In case ssh is used go for rsh and check again
hth
Hajo
-
Re: PATH environment variable for root is wrong
On 2008-09-11, TsanChung wrote:
[snip]
> I had read
> http://publib.boulder.ibm.com/infoce...opic/com.ibm.a...
> I double checked that PATH is defined only in
> /etc/environment
> but not defined in any of the following files for the root user:
> /etc/profile
> ~/.profile
> ~/.env
> ~/.kshrc
> but still cannot solve my problem.
> I even reboot my aix computer.
> However, the current PATH for root is still not the same as the PATH
> in /etc/environment.
On an AIX system that I use, /etc/profile ends with the lines
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. $i
fi
done
When a software package is installed, it may install files in the
/etc/profile.d directory. These files do per login setup for the
software, such as adding the directory where executables have been
installed to PATH. In this way, each user does not have to change
~/.profile, or related files, to use the software.
Chances are the directories being added to PATH were added by files in
/etc/profile.d. If the sofware packages that uses those directores are
no longer needed on the system, uninstall those packages. Otherwise,
consider changing one of the files executed after those in /etc/profile.d
so that the value of PATH is what you want it to be.
-
Re: PATH environment variable for root is wrong
On Sep 11, 11:26*am, Hajo Ehlers wrote:
> On Sep 11, 3:15 pm, TsanChung wrote:
>
>
>
> > On Sep 10, 6:19 pm, Hajo Ehlers wrote:
>
> > > On Sep 10, 11:46 pm, TsanChung wrote:
>
> > > > I want to set my PATH environment variable to /usr/bin:/etc:/usr/sbin:/
> > > > usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:
> > > > /usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
>
> > > > Therefore I modified the /etc/environment file to this:
> > > > PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/
> > > > jre/bin:
> > > > /usr/java6_64/bin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
>
> > > > Then I logoff and login again as root:
> > > > # echo $PATH
> > > > /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin:/usr/bin:/etc:/usr/
> > > > sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:/usr/java6_64/
> > > > bin:/usr/local/bin:/usr/opt/ifor/bin:/usr/local/bin
>
> > > > This is wrong.
>
> > > Its not wrong. Its just something you did not expect.
>
> > > > Why /usr/java14/jre/bin:/usr/java14/bin:/usr/vacpp/bin at the startof
> > > > the PATH environment variable?
>
> > > You should readhttp://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.a...
>
> > > Short: ( In case you did not changed the default shell or switching to
> > > a different shell during login )
> > > /etc/environment
> > > /etc/profile
> > > ~/.profile
> > > ~/.env
> > > ~/.kshrc
>
> > > enjoy and good night
> > > Hajo
>
> > I had readhttp://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.a...
> > I double checked that PATH is defined only in
> > /etc/environment
> > but not defined in any of the following files for the root user:
> > /etc/profile
> > ~/.profile
> > ~/.env
> > ~/.kshrc
> > but still cannot solve my problem.
> > I even reboot my aix computer.
> > However, the current PATH for root is still not the same as the PATH
> > in /etc/environment.
>
> Which tool is used to login ?
>
> Supply the output from
> $ ps
> $ cat ~/.profile
> $ cat $ENV
> $ ls -A ~ *| grep "^\." *| xargs -n1 -I{} grep *-n PATH */dev/null {}
> $ find *~/.ssh */etc/ssh/ -type file *| xargs -n1 -I{} grep *-n PATH /
> dev/null {}
>
> In case ssh is used go for rsh and check again
>
> hth
> Hajo
Following your instruction:
ls -A ~ | grep "^\." | xargs -n1 -I{} grep -n PATH /dev/null {}
..bash_history:19:echo $PATH
..bash_history:29:echo $PATH
..bash_history:34:echo $PATH
..bash_history:43:echo $PATH
..bash_history:53:echo $PATH
..bash_history:60:echo $PATH
..bash_history:61:echo $PATH
..bash_history:62:set |grep PATH
..bash_history:490:echo $PATH
..bash_history:493:grep PATH ~/.env
..bash_history:494:grep PATH ~/.kshrc
..bash_history:495:grep PATH ~/.bashrc
..cits-profile:3:MANPATH=$PATH
..cits-profile:4:export MANPATH
..cits-profile:12:PATH=/usr/vacpp/bin:$PATH:/usr/opt/ifor/bin:/usr/
local/bin
..cits-profile:13:export PATH
..cits-profile:15:unset LIBPATH
..cits-profile:17:unset CLASSPATH
..cits-profile:19:unset LD_LIBRARY_PATH
..cits-profile:25:export PATH=/usr/java14/jre/bin:/usr/java14/bin:$PATH
Therefore I modified the PATH in .cits-profile to
..cits-profile:12:PATH=/usr/vacpp/bin:$PATH:/usr/opt/ifor/bin
..cits-profile:25:#export PATH=/usr/java14/jre/bin:/usr/java14/bin:
$PATH
Now the PATH do not have the old java.
Thank you.
# echo $PATH
/usr/vacpp/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/
usr/java6_64/jre/bin:/usr/java6_64/bin:/usr/local/bin:/usr/opt/ifor/
bin