shell循环

其一:
从文件读取
while read line
do
scp $name $IP:/root/
done < ip
其二:
从列表读取
IP_list=(10.205.28.11 10.205.28.12 10.205.28.13 10.205.28.14 10.205.28.15 10.205.12.16 10.205.12.17 10.205.9.10 10.205.9.11 10.205.12.10 10.205.12.11 10.205.12.12 10.205.12.13 10.205.12.14 10.205.12.15)

for IP in ${IP_list[*]};do
ssh $ip 'systemctl stop firewalld'
done

posted @ 2019-06-05 15:36  大小狮子  阅读(147)  评论(0编辑  收藏  举报