linux - Access remote machine's exported variable via ssh -


so, trying this:

  • in 192.168.1.2 machine, had set export name=arun in .bash_profile file of www user
  • then executed source .bash_profile.
  • from 192.168.1.3 machine, trying ssh 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

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -