一. for循环应用

1、使用for循环创建用户

(1).创建用户列表

shell脚本应用(三)_连通性

shell脚本应用(三)_连通性_02

(2).创建for循环脚本

shell脚本应用(三)_for循环_03

(3).添加脚本执行权限运行脚本

shell脚本应用(三)_连通性_04

2、使用for脚本删除创建的用户

(1).创建删除用户脚本

shell脚本应用(三)_连通性_05

(2).添加执行脚本权限运行脚本

shell脚本应用(三)_for循环_06

3、使用 for 判断网路连通性

(1).创建IP地址列表

shell脚本应用(三)_连通性_07

(2).创建判断主机连通性脚本

shell脚本应用(三)_连通性_08

(3).添加执行权限运行脚本

shell脚本应用(三)_for循环_09

4、使用for结合read -p 接收用户入IP地址使用for测试 网络连通性

(1).创建脚本网络连通性脚本

shell脚本应用(三)_ip地址_10

shell脚本应用(三)_for循环_11

(2).运行脚本进行测试

shell脚本应用(三)_ip地址_12

二、while循环应用

1、使用while创建100个以benet的用户名字

(1).创建脚本文件

shell脚本应用(三)_连通性_13

(2).执行脚本

shell脚本应用(三)_for循环_14

2、将创建的100个账户删除

(1).编辑删除用户脚本

shell脚本应用(三)_连通性_15

shell脚本应用(三)_for循环_16

(2).删除创建的用户

shell脚本应用(三)_连通性_17

3、随机值进行判断,判断范围为2的16次方范围值内使用

(1).创建随机值判断脚本

shell脚本应用(三)_ip地址_18

(2).运行脚本

shell脚本应用(三)_连通性_19

三case服务控制脚本应用

1、使用case判断用户输入的是字符或者数字以及字母

(1).创建脚本

shell脚本应用(三)_for循环_20

(2).运行脚本

shell脚本应用(三)_for循环_21

2、配置case控制vsftpd服务

(1).挂载系统光盘

shell脚本应用(三)_连通性_22

(2).系统光盘挂载到/mnt目录

shell脚本应用(三)_for循环_23

(3).安装vsftpd服务

shell脚本应用(三)_for循环_24

(4).创建脚本控制文件

shell脚本应用(三)_连通性_25

(5).运行验证脚本

shell脚本应用(三)_for循环_26