Bash - Boolean Variable

About

The Boolean data type in Bash.

Bash has a true built-in.

Management

Condition

condition=true

if [ "$condition" = true ] ; then
    echo 'Go'
fi

# or double bracket format
if [[ "$bool" = true ]]; then
  echo 'Go'
fi

Operator


Powered by ComboStrap