try
ssh xxx@remot_machine "echo \$MYPWD"
or
ssh xxx@remot_machine 'echo $MYPWD'
主要是$转义的问题
【 在 DragonDon 的大作中提到: 】
: remote machine已经定义了一个环境变量,如MYPWD
: 现在local machine上执行:ssh xxx@remot_machine "echo $MYPWD",无法获得MYPWD
: 的正确值,尝试ssh xxx@remot_machine "source ~/.bashrc echo $MYPWD"也不起作用;
: 这是怎么回事,如何解决?
: ...................
--
FROM 120.229.207.*