Is it possible to use bash-like command substitution, like backticks `` or $() with lftp?
This is to e.g. cd into a directory given by a command:
lftp ..
cd `pwd`
Not quite what you looking for I guess but you can use -e option like this:
$ lftp -e "cd $HOME" <SITE>
As explained in man lftp:
-e commands Execute given commands and don't exit.
So after using -e as shown above lftp will take you to $HOME directory on the remote server.
I don't think it's possible to use all local environment variables inside lftp - man lftp clearly says that only some variables are honored.
I think that maybe ssh could be a better solution here.