gpt4 book ai didi

shell - 尝试在 mac 上运行命令时出现 fish 错误

转载 作者:行者123 更新时间:2023-12-04 16:29:44 26 4
gpt4 key购买 nike

我使用以下命令并安装了 fish

diff -y <(unzip -l old.zip) <(unzip -l new.zip)

我收到以下错误:
fish: Invalid redirection target: (unzip -l new.zip)
diff -y <(unzip -l new.zip) <(unzip -l old.zip)
^
fish: Invalid redirection target: (unzip -l old.zip)
diff -y <(unzip -l new.zip) <(unzip -l old.zip)

有解决方法吗?

最佳答案

<(a_command)语法是fish 不支持的bash'ism。为了与 fish 对显式命令而不是魔术语法的偏好保持一致,psub命令用于实现类似的效果:

diff -y (unzip -l new.zip | psub) (unzip -l old.zip | psub)

关于shell - 尝试在 mac 上运行命令时出现 fish 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48855508/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com