该脚本的前提是在 ~/.ssh/config 已经配置好的情况下使用
#!/bin/bash
#####################################################################
######## 服务器批量操作脚本
######## Email: i@liufang.org.cn
#####################################################################
for host in `cat ~/.ssh/config |grep 'Host '|awk -F ' ' '{print $2}'`
do
echo -e "\033[34m\r\nexec command:$1 at host $host \033[0m"
ssh $host $@
done