Shell变量[阮胜昌]

[root@localhost ~]# ll .bash*
-rw------- 1 root root 11120 Aug 21 21:21 .bash_history//记录用户以前输入的所有命令
-rw-r--r-- 1 root root    24 Jul 13  2006 .bash_logout //用户退出时要执行的命令
-rw-r--r-- 1 root root   191 Jul 13  2006 .bash_profile //用户登入时要执行的命令 ,只被执行一次
-rw-r--r-- 1 root root   176 Apr 12 15:01 .bashrc   //每次打开新的SHELL时要执行的命令


提示符
[root@localhost ~]# echo $PS1
[\u@\h \W]\$

-rw-r--r-- 1 root root   176 Apr 12 15:01 .bashrc //设置提示符的文件

环境变量:
[root@localhost ~]# set
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="1" [2]="17" [3]="1" [4]="release" [5]="i686-redhat-linux-gnu")
BASH_VERSION='3.1.17(1)-release'
COLORS=/etc/DIR_COLORS
COLUMNS=87
CVS_RSH=ssh
DIRSTACK=()
EUID=0
GROUPS=()
G_BROKEN_FILENAMES=1
HISTFILE=/root/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/root
HOSTNAME=localhost.localdomain
HOSTTYPE=i686
IFS=$' \t\n'
INPUTRC=/etc/inputrc
KDEDIR=/usr
KDE_IS_PRELINKED=1
KDE_NO_IPV6=1
LANG=en_US.UTF-8
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=33
LOGNAME=rscpass
LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:'
MACHTYPE=i686-redhat-linux-gnu
MAIL=/var/spool/mail/root
MAILCHECK=60
OLDPWD=/home
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
PIPESTATUS=([0]="127")
PPID=2616
PRELINKING=yes
PRELINK_FULL_TIME_INTERVAL=14
PRELINK_NONRPM_CHECK_INTERVAL=7
PRELINK_OPTS=-mR
PS1='[\u@\h \W]\$ '
PS2='> '
PS4='+ '
PWD=/root
QTDIR=/usr/lib/qt-3.3
QTINC=/usr/lib/qt-3.3/include
QTLIB=/usr/lib/qt-3.3/lib
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=4
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SSH_CLIENT='192.168.252.1 3944 22'
SSH_CONNECTION='192.168.252.1 3944 192.168.252.2 22'
SSH_TTY=/dev/pts/0
TERM=vt100
UID=0
USER=rscpass
_=wet
consoletype=pty
qt_prefix=/usr/lib/qt-3.3
定义局部变量:
#PATH=/usr/bin;
输出局部变量
#echo $PATH

定义全局变量:
#export PATH=$PATH:/some/directory

 

 


 

你可能感兴趣的:(shell)