Bash - Conditional Expression

> Procedural Languages > Bash Shell and (Unix|Linux) Utilities (XCU)

2 - Management

2.1 - Execution

2.1.1 - [[ conditional_expression ]]

Shell - Compound Commands

[[ conditional_expression ]]

where:

  • [[]] defines a conditional expression evaluation
  • conditional_expression is a conditional expression
  • Return a status of 0 or 1

note:

  • Word splitting and pathname expansion are not performed on the words between the Shell - && - AND Boolean operator;
  • tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal are performed.
  • Conditional operators such as -f must be unquoted to be recognized as primaries.
Advertising

2.2 - Test

To test a conditional expression, see the test command

test conditional_expression