linux shell


#!/bin/sh

HOST_LIST="host1 host2 host3 host4"
SSH_PORT=2202

for loop in $HOST_LIST
do
        echo "executing in $loop:"
        ssh -p $SSH_PORT $loop "$1"
        echo
done


./remotecommand.sh "tar zxvf /root/pat.tar.gz -C /home"

你可能感兴趣的:(java,C++,c,linux,ssh)