keyword

Bash pipeline negation

Inverts success or failure of a pipeline; nonzero becomes zero and zero becomes one.

Formal Syntax & Structure

bash syntaxbash
! pipeline

Return Value

behavior

Inverts success or failure of a pipeline; nonzero becomes zero and zero becomes one.

Working Example

Example Snippetbash
! falseprintf '%s\n' "$?"
Bash Reference