我有个有个疑惑
sh和. ./.bash_profile效果相同吗?
[monitor@host-lfs ~]$ sh .bash_profile
[monitor@host-lfs ~]$ echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[monitor@host-lfs ~]$ . .bash_profile
[monitor@host-lfs ~]$ echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/home/monitor/bin
我这里的结果是不同的
在.bash_profile重新配置的的环境变量,使用source .bash_profile 来生效