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