arithmetic-operator

Bash ~ arithmetic operator

Complements the bits of the fixed-width integer.

Formal Syntax & Structure

bash syntaxbash
$(( ~ 0 ))

Return Value

integer

Complements the bits of the fixed-width integer.

Working Example

Example Snippetbash
printf '%s\n' "$(( ~ 0 ))"
Bash Reference