bash shell脚本之查看系统环境变量

时间:2014-10-15 23:04:41   收藏:0   阅读:212

查看当前系统环境变量

cat test2:

#!/bin/bash
# display user information from the system.
echo "User info for userid:$USER"
echo UID:$UID
echo HOME:$HOME

添加执行权限:chmod u+x test2

运行:./test2 结果如下:

User info for userid:clarck
UID:1000
HOME:/home/clarck

 

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!