#!/bin/bash

Files="temp.sh"
Target_dir='/root'
#HOSTS="71 72 73 74 81"
HOSTS="35 36"

#Generates the file
cat << EOT > /root/$Files

cat << EOL >> tt
echo "Hello"
EOL


EOT



for i in $HOSTS;
do

        echo "##########################";
        echo Running 192.168.37.$i;
        scp  /root/$Files 192.168.37.$i:$Target_dir;
	ssh 192.168.37.$i bash ${Target_dir}/${Files}
        echo Done;
        echo;
	echo;

done;

echo "CMD_Finished"
