When I run the bash shell from the following:
bash -c '(export abc=123 && echo $abc)'
Output: "123". But when I run it on top of ssh :
ssh remote-host "bash -c '(export abc=123 && echo $abc)'"
There is no conclusion. Why is this? Is there any way around this? That is, is there a way to set the environment variable for the command over which I am running ssh ?
Note. When I replace echo $abc with something standard, like echo $USER , the ssh command prints the username on the remote computer as expected, as it is already installed.
I am running RHEL 5 Linux with OpenSSH 4.3
source share