Running a Block of Shell Script remotely using SSH

前端 未结 2 377
旧巷少年郎
旧巷少年郎 2021-01-28 16:07

I am try to execute a block of commands on a different server using a shell script

Can anyone please help me on this

while [ $RecordCount -gt 0 ]
do
  ex         


        
2条回答
  •  礼貌的吻别
    2021-01-28 16:39

    Just stream those commands into ssh stdin, like:

    ssh remoteserver << EOF
    command1
    command2
    command3
    ...
    EOF
    

    << here means here-doc - a multiline quote.

提交回复
热议问题