Execute Loop in Telnet

hi Everyone , have a nice day

#!/bin/sh
( sleep 1
 echo "LOGIN:username:password;"
 sleep 1 
 while IFS= read -r line
 do
 #echo $line
 GET:VOUCHERDETAIL:VoucherSerialNumber,$line; >> /home/status_log
 done < /home/status.txt
 sleep 1
 echo "LOGOUT;") | telnet 127.0.0.1 7021

,

it throws the following output

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
RESP:0;
./voucher1.sh: -r: is not an identifier
Connection to 127.0.0.1 closed by foreign host.

help will be appreciated
Regards and Waiting

Well debugged it a little though

#!/bin/sh
echo "Input file Name: "
read file


( sleep 1
 echo "LOGIN:user:password;";
 sleep 1
cat $file | while read LINE
do 
 echo "GET:VOUCHERDETAIL:VoucherSerialNumber,$LINE;";
 sleep 1 
done</home/$file
 sleep 1 
 echo "LOGOUT;") | telnet 127.0.0.1 7021

above code is working fine but its giving me all output on command line , i want output to go in a file , how can i do that:confused:

Regards

no one :confused: