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.
Asked
Active
Viewed 3,732 times
1 Answers
7
POSIX shells, including bash, zsh and dash, support the ! modifier:
! foo | bar
u1686_grawity
- 426,297
- 64
- 894
- 966