简体   繁体   中英

Fish error while trying to run command on mac

I use the following command and I have fish installed

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

and I get the following error :

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)

is there a workaround?

The <(a_command) syntax is a bash'ism not supported by fish. In keeping with the fish preference for explicit commands rather than magic syntax the psub command is used to achieve a similar effect:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM