![如何在 Fish 中链接一组命令,例如 {...} Bash?](https://linux22.com/image/1710475/%E5%A6%82%E4%BD%95%E5%9C%A8%20Fish%20%E4%B8%AD%E9%93%BE%E6%8E%A5%E4%B8%80%E7%BB%84%E5%91%BD%E4%BB%A4%EF%BC%8C%E4%BE%8B%E5%A6%82%20%7B...%7D%20Bash%EF%BC%9F.png)
我知道&&
通过或链接 Fish 命令||
但我愿意串联一组命令s
代码
env git clone --depth=1 https://github.com/rafaelrinaldi/theme-pure.git; or {
printf "Error: git clone of theme-pure repo failed\n"
exit 1
}
答案1
您需要使用begin
和end
关键字来解决这个问题(感谢格伦·杰克曼评论):
env git clone --depth=1 https://github.com/rafaelrinaldi/theme-pure.git; or begin;
printf "Error: git clone of theme-pure repo failed\n"
exit 1
end
文件
参见官方文档begin - 开始新的代码块。