[root@localhost /]# env
path
[root@localhost /]# path=/usr/local/
[root@localhost /]# echo $path
/usr/local/
path
的值时, 此时path
输出内容为空值[root@localhost /]# su hlj
[hlj@localhost /]$ echo $path
[hlj@localhost /]$
path
变量的值时,先退回到root用户export[hlj@localhost /]$ exit
[root@localhost /]# export path
[root@localhost /]# su hlj
[hlj@localhost /]$ echo $path
/usr/local/