通过scp批量推送文件到远程目录
[root@openfire1 script]# cat test.sh
#!/bin/bash
#通过scp推送文件到远程目录
for ip in `cat iplist`
do
echo $1
if [[ -z $1 ]]; then #"-z",如果为空
echo "Not find command."
break
else
echo "$ip----------------------"
scp -r -p $1 $ip:$2
fi
done
[root@openfire1 script]# sh test.sh /