Monday 9 September 2013

ssh in a loop

Using ssh in a loop will break the loop to fix this use the -n flag, i.e:-

while read server
do
   echo $server
   ssh -n $server "ls -l /etc/rc.modules"
   echo
done < servers