摘要: [root@master2 ~]# INTERNAL_IP=$(ip addr show eth0 | grep "inet " | awk '{print $2}' | cut -d / -f 1) [root@master2 ~]# echo ${INTERNAL_IP} 10.1.90.182 阅读全文
posted @ 2020-10-25 19:44 LeoShi2020 阅读(320) 评论(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 阅读(119) 评论(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 阅读(3999) 评论(0) 推荐(0)