当前位置: 技术问答>linux和unix
AIX上的PATH环境变量的问题
来源: 互联网 发布时间:2016-11-10
本文导语: 各位大鸟,我有一台AIX的机器(AIX 5.3L),装系统的时候安装了一个IBM jre 1.4.2。 但是我要用更高版本的JRE,所以我安装了jre 1.5和jre 1.6。 但是问题来了,我的环境变量: bash-3.2# echo PATH=$PATH PATH=/usr/bin:/etc:/usr/sbin:/us...
各位大鸟,我有一台AIX的机器(AIX 5.3L),装系统的时候安装了一个IBM jre 1.4.2。
但是我要用更高版本的JRE,所以我安装了jre 1.5和jre 1.6。
但是问题来了,我的环境变量:
bash-3.2# echo PATH=$PATH
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin
在安装完jre之后并没有改过来。
我查了一下/etc/profile:
trap "" 1 2 3
readonly LOGNAME
# Automatic logout, include in export line if uncommented
# TMOUT=120
# The MAILMSG will be printed by the shell every MAILCHECK seconds
# (default 600) if there is mail in the MAIL system mailbox.
MAIL=/usr/spool/mail/$LOGNAME
MAILMSG="[YOU HAVE NEW MAIL]"
# If termdef command returns terminal type (i.e. a non NULL value),
# set TERM to the returned value, else set TERM to default lft.
TERM_DEFAULT=lft
TERM=`termdef`
TERM=${TERM:-$TERM_DEFAULT}
# If LC_MESSAGES is set to "C@lft" and TERM is not set to "lft",
# unset LC_MESSAGES.
if [ "$LC_MESSAGES" = "C@lft" -a "$TERM" != "lft" ]
then
unset LC_MESSAGES
fi
export LOGNAME MAIL MAILMSG TERM
trap 1 2 3
除此以外就全是注释了。
我的home目录中也没有.profile之类的文件:
bash-3.2# ls -al ~/
total 168
drwxr-xr-x 20 root system 4096 Feb 27 21:55 .
drwxr-xr-x 20 root system 4096 Feb 27 21:55 ..
-rw------- 1 root system 1089 Feb 27 23:46 .bash_history
-rw------- 1 root system 712 Feb 27 23:48 .sh_history
drwx------ 2 root system 256 Feb 23 00:23 .ssh
-rw------- 1 root system 24 Feb 28 00:08 .vi_history
drwxr-xr-x 2 root system 256 Feb 18 03:36 PowerMgr
drwxr-x--- 2 root audit 256 Oct 09 2007 audit
lrwxrwxrwx 1 bin bin 8 Feb 17 23:24 bin -> /usr/bin
drwxr-xr-x 2 root system 256 Feb 18 03:36 build
drwxrwxr-x 5 root system 4096 Feb 27 23:38 dev
drwxr-xr-x 29 root system 8192 Feb 27 23:42 etc
drwxr-xr-x 6 bin bin 256 Feb 27 23:38 home
lrwxrwxrwx 1 bin bin 8 Feb 17 23:24 lib -> /usr/lib
drwx------ 2 root system 256 Feb 17 23:24 lost+found
drwxr-xr-x 149 bin bin 8192 Feb 27 23:42 lpp
drwxr-xr-x 2 bin bin 256 Oct 09 2007 mnt
drwxr-xr-x 13 root system 4096 Feb 17 23:54 opt
dr-xr-xr-x 1 root system 0 Feb 28 00:08 proc
drwxr-xr-x 3 bin bin 256 Feb 17 23:53 sbin
-rw-r--r-- 1 root system 17847 Feb 27 23:42 smit.log
-rw-r--r-- 1 root system 2033 Feb 27 23:39 smit.script
-rw-r--r-- 1 root system 3405 Feb 27 23:39 smit.transaction
drwxr-xr-x 2 root system 256 Feb 18 03:36 team
drwxrwxr-x 2 root system 256 Feb 17 23:37 tftpboot
drwxrwxrwt 4 bin bin 4096 Feb 28 00:00 tmp
lrwxrwxrwx 1 bin bin 5 Feb 17 23:24 u -> /home
lrwxrwxrwx 1 root system 21 Feb 17 23:56 unix -> /usr/lib/boot/unix_64
drwxr-xr-x 43 bin bin 4096 Feb 27 23:42 usr
drwxr-xr-x 28 bin bin 4096 Feb 23 10:21 var
各位谁知道应该怎么去替换这个$PATH么?(我知道可以在~/.profile中把PATH中关于jre的一段去掉,但我觉得那不是一个好办法。最好能找出jre 1.4.2在安装的时候到底改了哪个文件。)
但是我要用更高版本的JRE,所以我安装了jre 1.5和jre 1.6。
但是问题来了,我的环境变量:
bash-3.2# echo PATH=$PATH
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin
在安装完jre之后并没有改过来。
我查了一下/etc/profile:
trap "" 1 2 3
readonly LOGNAME
# Automatic logout, include in export line if uncommented
# TMOUT=120
# The MAILMSG will be printed by the shell every MAILCHECK seconds
# (default 600) if there is mail in the MAIL system mailbox.
MAIL=/usr/spool/mail/$LOGNAME
MAILMSG="[YOU HAVE NEW MAIL]"
# If termdef command returns terminal type (i.e. a non NULL value),
# set TERM to the returned value, else set TERM to default lft.
TERM_DEFAULT=lft
TERM=`termdef`
TERM=${TERM:-$TERM_DEFAULT}
# If LC_MESSAGES is set to "C@lft" and TERM is not set to "lft",
# unset LC_MESSAGES.
if [ "$LC_MESSAGES" = "C@lft" -a "$TERM" != "lft" ]
then
unset LC_MESSAGES
fi
export LOGNAME MAIL MAILMSG TERM
trap 1 2 3
除此以外就全是注释了。
我的home目录中也没有.profile之类的文件:
bash-3.2# ls -al ~/
total 168
drwxr-xr-x 20 root system 4096 Feb 27 21:55 .
drwxr-xr-x 20 root system 4096 Feb 27 21:55 ..
-rw------- 1 root system 1089 Feb 27 23:46 .bash_history
-rw------- 1 root system 712 Feb 27 23:48 .sh_history
drwx------ 2 root system 256 Feb 23 00:23 .ssh
-rw------- 1 root system 24 Feb 28 00:08 .vi_history
drwxr-xr-x 2 root system 256 Feb 18 03:36 PowerMgr
drwxr-x--- 2 root audit 256 Oct 09 2007 audit
lrwxrwxrwx 1 bin bin 8 Feb 17 23:24 bin -> /usr/bin
drwxr-xr-x 2 root system 256 Feb 18 03:36 build
drwxrwxr-x 5 root system 4096 Feb 27 23:38 dev
drwxr-xr-x 29 root system 8192 Feb 27 23:42 etc
drwxr-xr-x 6 bin bin 256 Feb 27 23:38 home
lrwxrwxrwx 1 bin bin 8 Feb 17 23:24 lib -> /usr/lib
drwx------ 2 root system 256 Feb 17 23:24 lost+found
drwxr-xr-x 149 bin bin 8192 Feb 27 23:42 lpp
drwxr-xr-x 2 bin bin 256 Oct 09 2007 mnt
drwxr-xr-x 13 root system 4096 Feb 17 23:54 opt
dr-xr-xr-x 1 root system 0 Feb 28 00:08 proc
drwxr-xr-x 3 bin bin 256 Feb 17 23:53 sbin
-rw-r--r-- 1 root system 17847 Feb 27 23:42 smit.log
-rw-r--r-- 1 root system 2033 Feb 27 23:39 smit.script
-rw-r--r-- 1 root system 3405 Feb 27 23:39 smit.transaction
drwxr-xr-x 2 root system 256 Feb 18 03:36 team
drwxrwxr-x 2 root system 256 Feb 17 23:37 tftpboot
drwxrwxrwt 4 bin bin 4096 Feb 28 00:00 tmp
lrwxrwxrwx 1 bin bin 5 Feb 17 23:24 u -> /home
lrwxrwxrwx 1 root system 21 Feb 17 23:56 unix -> /usr/lib/boot/unix_64
drwxr-xr-x 43 bin bin 4096 Feb 27 23:42 usr
drwxr-xr-x 28 bin bin 4096 Feb 23 10:21 var
各位谁知道应该怎么去替换这个$PATH么?(我知道可以在~/.profile中把PATH中关于jre的一段去掉,但我觉得那不是一个好办法。最好能找出jre 1.4.2在安装的时候到底改了哪个文件。)
|
man environment
The /etc/environment file contains variables specifying the basic environment for all processes.
The /etc/environment file contains variables specifying the basic environment for all processes.