shell脚本面试题
2016-03-04 12:25
921 查看
#!/bin/bash if [ ! -d /rhome ] then mkdir -p /rhome fi continue uid=1000 for i in `seq 1 30`;do if [ $i -lt 16 ] then useradd -d /rhome/user$i -s /bin/bash user$i -u $(($uid+$i)) echo "redhat|passwd user$i --stdin" elif [ $i -gt 15 ] then useradd -d /rhome/user$i -s /sbin/nologin user$i -u $(($uid+$i)) echo "redhat|passwd user$i --stdin" fi done
相关文章推荐
- 一个关于if else容易迷惑的问题
- android wifi 无线调试
- 运维入门
- 动态清空 nohup 输出文件
- install scrapy with pip and easy_install
- Linux Shell常用技巧
- Shell 脚本编程陷阱
- VBS脚本写的Windows硬件检测工具分享
- 用vbscript实现隐藏任务栏图标的脚本
- 用autoit编写第一个脚本(Hello World)
- VBS调用WMI快速关闭IE的脚本
- Oracle数据库执行脚本常用命令小结
- 收集的ROS防火墙脚本
- JSP脚本漏洞面面观
- shell字符串操作详解
- 不错的批处理脚本 第一部分
- VBS脚本加密/解密VBS脚本(简易免杀版1.1)
- 不错的批处理脚本实例代码 第二部分