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.
foo | bar
POSIX shells, including bash, zsh and dash, support the ! modifier:
! foo | bar
4 years ago