随笔分类 -  Shell

摘要:1. Shell for循环跳跃不连续数 for i in {"172.15.7."{101..106},"172.15.7."{109..111},"160.168.103."{191..192}};do ssh ${i} "date";done # 进一步整合 for i in {"172.15 阅读全文
posted @ 2021-10-21 08:17 LeoShi2020 阅读(76) 评论(0) 推荐(0) 编辑
摘要:1. '#' 截取关键字右侧 ]# STR='DISTANCE_ESXi_7SERVER_IP=172.15.7.133' ]# echo ${STR} DISTANCE_ESXi_SERVER_IP=172.15.7.133 # 从左往右找到第一个关键字7匹配,截取关键字右侧所有字符 ]# ech 阅读全文
posted @ 2021-08-18 11:34 LeoShi2020 阅读(78) 评论(0) 推荐(0) 编辑
摘要:创建数组 HOST_NAME=(master1 master2 master3 node1 node2 node3) 查看数组下标(索引)和值 [root@master1 ~]# echo ${!HOST_NAME[*]} 0 1 2 3 4 5 [root@master1 ~]# echo ${H 阅读全文
posted @ 2020-10-25 13:03 LeoShi2020 阅读(115) 评论(0) 推荐(0) 编辑
摘要:定义一个字典名称 declare -A ipaddress 赋值 ipaddress=([master1]="10.1.90.181" [master2]="10.1.90.182" [master3]="10.1.90.183" [node1]="10.1.90.184" [node2]="10. 阅读全文
posted @ 2020-10-25 12:47 LeoShi2020 阅读(3979) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示