linux shell脚本无法改变环境变量#!/bin/bashPATH$PATH:/home/kuangexport PATHecho hello world!exit
linux shell脚本无法改变环境变量
#!/bin/bash
PATH=$PATH:/home/kuang
export PATH
echo "hello world!"
exit
运行完这段脚本之后,发现环境变量并没有添加/home/kuang
[解决办法]
在shell命令行下, 使用source命令运行脚本。
[解决办法]
在shell命令行下, 使用source命令运行脚本。
