Tweeted twitter.com/StackUnix/status/709116040295354368
3 edited tags
| link
2 edited tags
| link
1
source | link

File descriptors and redirect in bash

Can someone explain why this command works:

gpg --enable-special-filenames --verify --batch \
  <(curl -s https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.0.29.tar.bz2.sig) \
  <(curl https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.0.29.tar.bz2)

And this fails with "curl: (23) Failed writing body (0 != 4096) (23) Failed writing body" error message:

gpg --enable-special-filenames --verify --batch -- '-&3' '-&4' \
  3<(curl -s https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.0.29.tar.bz2.sig) \
  4<(curl https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.0.29.tar.bz2)