sftp file renaming

Hi Admins,

I am trying to get a file with different name including date format using sftp.

For example --> get test.bak auto`date +"%Y%m%d"`err

Here i am trying to get the file test.back with name auto20120126err

But file is copied with the name auto`date --> date is not printing

Please suggest how to get the name with date format.

Regards
Pavan

spaces in a unix filename will cause you big trouble later on, don't do it, it is a windows-thing.
If you have ssh keys setup:

# 
newname="auto_"
dt$( date +%Y%m%d)
sftp someplace.com <<EOF
 get myfile ${newname}.${dt}
 exit
EOF