How to negate exit code status to be used in Kubernetes
livenessProbe
?
I'll be using the grep
command and I would like to do below as a check.
- Return exit value 0, if
grep
has no hit - Return exit value 1, if
grep
has a hit
Since normally, grep will return 0 if there is a hit, can I negate this something like shown below?
!$(cat filet.txt | grep keyword)