分类: LINUX
2010-06-17 23:16:13
当前环境变量的配置文件在用户家目录的:vim /root/.bash_profile
全局环境变量的配置文件在:vim /etc/profile
在变量设置中,单引号和双引号的用途不一样:
[root@linux ~]#name=linsco
[root@linux ~]#ehco name
linsco
[root@linux ~]#myname="$name its me"
[root@linux ~]#ehco myname
linsco its me
[root@linux ~]#myname='$name ist me'
[root@linux ~]#echo myname
$name its me
''使其失去了原有的变量功能。
-------------------------------
for num in $(seq 1 10)
do
var[$num]=linsco$num
echo "${var[$num]}"
done
----------------------------------------
linsco1
linsco2
linsco3
linsco4
linsco5
linsco6
linsco7
linsco8
linsco9
linsco10
777 0111:0111:0111
umask 022 0010:0010:0010
touch file 644 0110:0100:0100
mkdir directory 755 0111:0101:0101
777 0111:0111:0111
umask 033 0011:0011:0011
touch file 633 0110:0100:0100
mkdir directory 744 0111:0100:0100