"while read ..." loop exiting after reading only one record

Greeting,

The following script completes after reading only one record from the input file that contains many records. I commented out the "ssh" and get what I expect, an echo of all the records in the input.txt file. Is ssh killing the file handle?

On the box "uname -a" gives "SunOS Server01 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V490".

#!/bin/ksh
\rm -f /tmp/x/*
let i=0
IFS=,
while read server dir; do
let i=i+1
echo "Record $i: ${server} ${dir}"
dir_=`echo ${dir} | tr "[/]" "[_]"`
ssh ${server} find ${dir} -follow  >/tmp/x/${server}${dir_}.txt
es=$?
echo "exit status = $es\n"
done < input.txt

Hi.

Try using the -n option of ssh.

Thanks, that did make the script work more the way I was expecting.