How to pass local variable to remote using ssh and bash script?

前端 未结 2 1830
野性不改
野性不改 2021-01-13 16:22
ssh remotecluster \'bash -s\' << EOF
> export TEST=\"sdfsd\"
> echo $TEST
> EOF

This prints nothing.

Also it still does not

2条回答
  •  庸人自扰
    2021-01-13 16:48

    export variable, ssh send exported(environment) variables to server export VAR=test ssh -v 127.0.0.1 echo $VAR test above commands and see result

提交回复
热议问题