首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

linux shell脚本没法改变环境变量

2012-08-15 
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命令运行脚本。

热点排行