Zsh pipes all output to the command

In Zsh, I know what you can do command &> file.txt

to pass all file descriptors to a .txt file (instead of making each file descriptor individually, as command 2>&1 3>&1 > file.txt

if you had three file descriptors). Is there a way to pass all file descriptors to another command? such as command <mystery operator> cat

?

Edit: I was wrong as noted by Hepner and Ethan; &>

only redirects fd 1 and 2. Thanks!

+3


source to share


1 answer


&>

only redirects standard output and standard error, not all file descriptors it command

can write. However, the equivalent pipe



command |& grep  # Equivalent to command 2>&1 | grep

      

+6


source







All Articles