用于在远程服务器上运行命令的 Fish 脚本

时间:2021-02-07 12:28:13

标签: ssh fish

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

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

鱼的类似物是什么?

1 个答案:

答案 0 :(得分:4)

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
相关问题