I am trying to execute a perl script from source A to invoke another 
script on 5 remote servers. The script is as follows: 

#!/usr/bin/perl 

open file, "server_list.txt"; 
@content = <file>; 
$tot=$#content+1; 
print "$tot \n"; 

while ($tot > 0) 
{ 
$m = shift @content; 
print "$m \n"; 
`ssh -x -t $m "sudo /home/tadipah/test.sh"` ; 
sleep 5; 
exit 
} 
Server_list above has the list of servers the script needs to be executed 
on. 
Above script works fine until it connects to the server and asks me the 
password. After I type the password, the putty sessions freezes. 

When I use the line below alone without the while or foreach loop, it 
works absolutely fine and returns me the output of the script test.sh from 
remote computer. 
`ssh -x -t SERVERNAME "sudo /home/tadipah/test.sh"` ; 

Any help is appreciated. 

Reply via email to