# 其中的$LOGNAME 就是获取登陆的用户名
#!/bin/bash# if user is root rebold else change to root than rebolduser=$LOGNAMEecho "$user"if [ "$user" = "root" ]thenecho " user is root rebort system"init 6elseecho "$user end "exit 1fi
本文共 270 字,大约阅读时间需要 1 分钟。
# 其中的$LOGNAME 就是获取登陆的用户名
#!/bin/bash# if user is root rebold else change to root than rebolduser=$LOGNAMEecho "$user"if [ "$user" = "root" ]thenecho " user is root rebort system"init 6elseecho "$user end "exit 1fi
转载于:https://my.oschina.net/u/1454838/blog/524473