循环脚本

for h in `cat ok.txt`; do  ssh $h 'for u in `ml all`; do rsync -aP /root/init_ldap_centos.sh $u:/root/ && ssh $u "bash /root/init_ldap_centos.sh"; done'; done

原文地址:https://www.cnblogs.com/tengfei520/p/6644687.html