linux - Access remote machine's exported variable via ssh -
so, trying this:
- in
192.168.1.2
machine, had setexport name=arun
in.bash_profile
file ofwww
user - then executed
source .bash_profile
. - from
192.168.1.3
machine, tryingssh www@192.168.1.2 "echo $name"
this giving me blank. not supposed return me arun
?
no. need escape variable evaluated on remote shell, not in local:
ssh www@192.168.1.2 ". .bash_profile;echo \$name"
Comments
Post a Comment