Running a Bash script over ssh

后端 未结 5 1380
春和景丽
春和景丽 2020-11-28 07:05

I\'m trying to write a Bash script that will SSH into a machine and create a directory. The long-term goal is a bit more complicated, but for now I\'m starting simple. Howev

5条回答
  •  野性不改
    2020-11-28 07:47

    The shell on the local host is doing variable substitution on $NOW and $BACKUP because the "EOI" isn't escaped. Replace

     ssh tunneluser@111.222.333.444 <

    with

     ssh tunneluser@111.222.333.444 <<\EOI
    

提交回复
热议问题