I have problems ftp'in a file

I have a directory in WINDOWS with a series of files like this:

 
3526_334690.dat 
3526_337092.dat  
3526_337933.dat

I want to retrieve the last one and FTP to a unix directory
I have (trying the three of them) the following commands in my script (shl script)

LocalDir="${MPATH}/middlebury/dat_files";
CDRemoteDir='orgs/"Financial Aid"/CSS/idocload';
echo $CDRemoteDir
##UpLoadFileName = '$(ls -rt | tail -1)';
UpLoadFileName='3526_420563.dat' (this works)
##UpLoadFilename=$(grep 3526 $tmpFile | sort 8 | awk '{fn=$9} END{print fn}'); 
echo $UpLoadFileName;
echo $tmpFile;

UpLoadFileName='3526_420563.dat' (this works but I don't know the last file number, I only know the 3526, it is constant,
so when I try UpLoadFileName = '$(ls -rt | tail -1)' I got the error not found,
when I try UpLoadFilename=$(grep 3526 $tmpFile | sort 8 | awk '{fn=$9}
can not open
what I am doing wrong, I am in windows XP trying to ftp to UNIX
Thank you

UpLoadFileName = '$(ls -rt | tail -1)';

you are having space on the both side of "=".
remove them.

UpLoadFileName='$(ls -1rt | tail -1)'

It does not work
when I put the backticks
UpLoadFileName=`$(ls -rt | tail -1)`
it just sit there
when I do the ='$(ls -rt | tail -1)'
don't do anything.. :mad:

I just observed, you should use double quotes.

UpLoadFileName="$(ls -1rt | tail -1)"