尝试在mac上运行命令时出现鱼错误

时间:2018-02-18 19:08:59

标签: shell cmd 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)

有解决方法吗?

1 个答案:

答案 0 :(得分:6)

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

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