arithmetic-operator

Bash || arithmetic operator

Logical OR yields 1 if either operand is nonzero; short-circuits on nonzero left operand.

Formal Syntax & Structure

bash syntaxbash
$(( 0 || 3 ))

Return Value

integer

Logical OR yields 1 if either operand is nonzero; short-circuits on nonzero left operand.

Working Example

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