linux raid while、until循环 bash组合测试条件

简介:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
1.Raid (redandent array of independent disks)
     软件rai md 可以组合任何块设备
     mdadm [mode < raiddevice > [option] < component_device >
     
     mdadm 模式化工具
         -A 装配模式
         -C 创建模式
         -F 监控模式
         -D 显示阵列详细信息
         管理模式
             -f 设备损坏
             -r 设备移除
             -a 替换设备
             
          -C 创建模式  
              -n# 用于创建raid的设备个数
              -x# 热备盘的个数
              -l 指定raid级别
              -a=--auto yes  自动为创建的raid设备创建文件
              
    eg:mdadm -C /dev/md0 -a yes -l 0 -n 2 /dev/sdb{1.2} 
    
    
2.while 条件测试 ; do
     循环体
done
 
3.until 测试条件 ; do
     循环体
done
 
4.bash 编程之组合测试条件
     逻辑与 :多个条件同时满足
     [ condition ] && [ condition2]
     [ condition -a condition2 ]
     [[ condition && condition2 ]]
     
     前两个使用单或双括号都可,但是&&不允许用于单括号中,所以第三种能使用双括号
     
     逻辑或
     [ condition ] || [ condition2 ]
     [ condition ] -o [ condition2 ]
     [[ condition || condition2 ]]
     第三种只能使用双括号
     
     !(条件1 或 条件2)= !条件1 并且 !条件2
     !(条件1 并且 条件2) = !条件1 或 !条件2




















本文转自wanglm51051CTO博客,原文链接:http://blog.51cto.com/studyit2016/1785354  ,如需转载请自行联系原作者

相关文章
|
5月前
|
Linux Shell
linux自动崩溃,模拟测试
该脚本创建一个 systemd 服务和定时器,在系统启动3分钟后触发崩溃。通过向 /proc/sysrq-trigger 写入 &quot;c&quot; 来实现内核崩溃,用于测试系统崩溃后的恢复机制。
137 4
|
2月前
|
SQL 安全 Linux
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
135 1
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
|
2月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
188 1
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
|
3月前
|
安全 Linux 网络安全
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
294 2
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
|
3月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
397 1
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
|
3月前
|
安全 Linux 网络安全
Metasploit Framework 6.4.88 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.88 (macOS, Linux, Windows) - 开源渗透测试框架
564 0
|
4月前
|
运维 Linux 开发者
Linux系统中使用Python的ping3库进行网络连通性测试
以上步骤展示了如何利用 Python 的 `ping3` 库来检测网络连通性,并且提供了基本错误处理方法以确保程序能够优雅地处理各种意外情形。通过简洁明快、易读易懂、实操性强等特点使得该方法非常适合开发者或系统管理员快速集成至自动化工具链之内进行日常运维任务之需求满足。
256 18
|
3月前
|
存储 安全 Linux
Kali Linux 2025.3 发布 (Vagrant & Nexmon) - 领先的渗透测试发行版
Kali Linux 2025.3 发布 (Vagrant & Nexmon) - 领先的渗透测试发行版
551 0
|
安全 Linux 测试技术
OpenText Static Application Security Testing (Fortify) 25.3 (macOS, Linux, Windows) - 静态应用安全测试
OpenText Static Application Security Testing (Fortify) 25.3 (macOS, Linux, Windows) - 静态应用安全测试
243 0
|
3月前
|
缓存 安全 Linux
Metasploit Pro 4.22.8-2025082101 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025082101 (Linux, Windows) - 专业渗透测试框架
180 0