#!/bin/bash if [ $# -lt 1 ] ; then echo no args exit; fi echo -----------------xcall $arg1 from localhost----------------- $@ echo #get first argument for (( i=0;i<=3;i=i+1)); do echo --------------------xcall $arg1 from Slave$i ------------------; ssh Slave$i$@ echo done