linux shell脚本无法改变环境变量
#!/bin/bash
PATH=$PATH:/home/kuang
export PATH
echo "hello world!"
exit
运行完这段脚本之后,发现环境变量并没有添加/home/kuang
[解决办法]
在shell命令行下, 使用source命令运行脚本。
[解决办法]
在shell命令行下, 使用source命令运行脚本。
发布时间: 2012-08-15 16:57:17 作者: rapoo
linux shell脚本无法改变环境变量
#!/bin/bash
PATH=$PATH:/home/kuang
export PATH
echo "hello world!"
exit
运行完这段脚本之后,发现环境变量并没有添加/home/kuang
[解决办法]
在shell命令行下, 使用source命令运行脚本。
[解决办法]
在shell命令行下, 使用source命令运行脚本。