4

I want to invert the exit code of a piped command sequence: foo | bar within the ZSH. So 0 maps to 1 and 1-128 maps to 0.

math
  • 2,693

1 Answers1

7

POSIX shells, including bash, zsh and dash, support the ! modifier:

! foo | bar
grawity
  • 501,077