How have both local and remote variable inside an SSH command
I think this is what you want: A=3; ssh host@name “B=3; echo $A; echo \$B;” When you use double-quotes: Your shell does auto expansion on variables prefixed with $, so in your first example, when it sees ssh host@name “B=3; echo $A; echo $B;” bash expands it to: ssh host@name “B=3; echo 3; echo ;” … Read more