日期:2014-05-16  浏览次数:20765 次

linux shell脚本无法改变环境变量
#!/bin/bash
PATH=$PATH:/home/kuang
export PATH
echo "hello world!"
exit

运行完这段脚本之后,发现环境变量并没有添加/home/kuang

------解决方案--------------------
在shell命令行下, 使用source命令运行脚本。
------解决方案--------------------
在shell命令行下, 使用source命令运行脚本。