【问题标题】:Fish script for running commands on remote server用于在远程服务器上运行命令的 Fish 脚本
【发布时间】:2021-02-07 12:28:13
【问题描述】:

如果我使用 sh 脚本,我会得到此代码。

ssh user@host <<-'ENDSSH'
    #command 1
    #command 2
ENDSSH

鱼的类似物是什么?

【问题讨论】:

    标签: ssh fish


    【解决方案1】:

    fish 没有 heredocs(请参阅 https://fishshell.com/docs/current/design.html

    echo '#command 1
    #command 2' | ssh user@host
    

    set commands \
        "command 1" \
        "command 2"
    
    printf "%s\n" $commands | ssh user@host
    

    【讨论】:

      猜你喜欢
      • 2010-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-21
      • 2017-05-22
      • 1970-01-01
      • 2015-05-16
      • 2021-09-04
      相关资源
      最近更新 更多