C-Shell Script Problem

I am trying to write a simple script to update clients that are probes with new software, but everytime I run it, it doesn't wait for the download it just runs through the list of clients without finishing the download. I tried to use wait on the pid and I could use sleep for some crazy amount of time and that works, but I would like it to be more intelligent and let it finish one and then move to the next. I am embarrassed to show my script because its probably not proper but need help.

I am running it from the command line as follows:
sh programname file1

# command line format:
#
# sh programname [FILE1]
#
# where FILE1 is an input file containing a single list of ip's (hosts)
#
PID="${$}" #Current process id to be used
date 2>&1
for i in `cat $1`
do
if ping $i 64 1 | grep -s "100%"
then
echo $i": not on the Network!" >> REDO_PROBE
else
( echo "login"; sleep 1; echo "password"; sleep 1; echo "http://xx.xx.xx.xx/probe_software.txt"; sleep 1 ) | telnet $i 24;
fi
done

any ideas on how I can script this so it waits until the first process on the probe finishes before it moves to the next? I was also thinking about using touch file to have it wait but I can't find anything to copy to do that or know how to program it. Any help appreciated. Thanks!