FTP question

HI
In my script its like this

------------
echo "Enter filename"
read fname

ftp -v -n abcd.efh.kk.com << EOF
user userid pwd
bin
mget $fname.tar--not working if i give "$fname", works only as "demo.tar"
bye
------------

My target is to get a $fname.tar from a remote host.How ever ftp is not recognizing that unless i give the exact filename itself.Is there any work around to get that file from that remote host.

Appreciate your help.

change

mget $fname.tar

to

mget ${fname}.tar

Hi.

I presume there is a closing EOF?

When you typed in the name, did you type demo, or demo.tar?

Can you post the error?

edit:

what a silly question!

BubbaJoe--Thanks

Scott--Valid point...Yes it has EOF at the end..

echo "Enter filename"
read fname
ftp -v -n abcd.efh.kk.com << EOF
user userid pwd
bin
mget $fname.tar--not working if i give "$fname", works only as "demo.tar"
bye
EOF

!!

I know it does (that's why it was a silly question), otherwise it wouldn't work at all!

As for the { } around the variable, it's interesting that that should make a difference, because in "normal shell", it would not be nessessary.