How to use SSH to run a local shell script on a remote machine?

前端 未结 17 1862
南笙
南笙 2020-11-21 22:33

I have to run a local shell script (windows/Linux) on a remote machine.

I have SSH configured on both machine A and B. My script is on machine A which will run some o

17条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-21 22:39

    if you wanna execute command like this temp=`ls -a` echo $temp command in `` will cause errors.

    below command will solve this problem ssh user@host ''' temp=`ls -a` echo $temp '''

提交回复
热议问题