Ssh connection from Sun OS to Linux server

Hello,

I ahve written a shell script which is doing ssh from UNIX Sun Os to multiple Linux servers one by one using loop. but after first iteration the script is getting exit. Rather it should connect to other linux server as well one by one. Please refer belwo code.

 
#!/bin/ksh
#set -x
HOME="/home/khichi"
CMD="grep hello /home/skhichi/a.txt"
cat $HOME/Linux_$SERVER | while read line
do
 ssh $line $CMD >> $HOME/hello
done

$HOME/Linux_$SERVER is having five linux server name.
the loop is getting exit after passing first server.

Not sure if this is script problem or ssh from unix to linux :confused:
Anyone?

Thanks,

Use the SSH -n option.

Thanks Bro .... it helped much .. relaxed now :slight_smile: