一. for循环应用
1、使用for循环创建用户
(1).创建用户列表
(2).创建for循环脚本
(3).添加脚本执行权限运行脚本
2、使用for脚本删除创建的用户
(1).创建删除用户脚本
(2).添加执行脚本权限运行脚本
3、使用 for 判断网路连通性
(1).创建IP地址列表
(2).创建判断主机连通性脚本
(3).添加执行权限运行脚本
4、使用for结合read -p 接收用户入IP地址使用for测试 网络连通性
(1).创建脚本网络连通性脚本
(2).运行脚本进行测试
二、while循环应用
1、使用while创建100个以benet的用户名字
(1).创建脚本文件
(2).执行脚本
2、将创建的100个账户删除
(1).编辑删除用户脚本
(2).删除创建的用户
3、随机值进行判断,判断范围为2的16次方范围值内使用
(1).创建随机值判断脚本
(2).运行脚本
三case服务控制脚本应用
1、使用case判断用户输入的是字符或者数字以及字母
(1).创建脚本
(2).运行脚本
2、配置case控制vsftpd服务
(1).挂载系统光盘
(2).系统光盘挂载到/mnt目录
(3).安装vsftpd服务
(4).创建脚本控制文件
(5).运行验证脚本