is it possible to use variables in remote ssh command?
I'd like to execute several commands in sequence on a remote machine, and some of the later commands depend on earlier ones. In the simplest possible example I get this: ssh my_server "echo this is my_server; abc=2;" this is my_server abc=2: Command not found. ssh my_server "echo this is my_server; abc=2; echo abc is $abc" abc: undefined variable For a bit of background info, what I actually want to do is piece together a path and launch a java application: ssh my_server 'nohup sh -c "( ( echo this is my_server; jabref_exe=`which jabref`; jabref_dir=`dirname $jabref_exe`; java -jar $jabref_dir