In OpenSSH_3.6.1p2 I tried this command I want a var to set and confirm as well . but this display none . ssh localhost "sh -c var=tell;echo $var" Please advice.