Shell - Compound Commands


A compound command is one of the following:





  • () defines the execution environment as a subshell
    • Variable assignments and builtin commands that affect the shell’s environment do not remain in effect after the command completes.
    • The return status is the exit status of list.
  • list is a list


{ list; }


  • {} defines a group command that is simply executed in the current shell environment.
  • - Since '{}' do not cause a word break, '{}' must be separated from list by whitespace.
  • list is a list
  • ;: a semicolon is the terminator (or a newline)
  • The return status is the exit status of list.




  • The expression is evaluated according to the rules described under ARITHMETIC EVALUATION.
  • If the value of the expression is:
    • non-zero, the return status is 0;
    • otherwise the return status is 1.

This is exactly equivalent to/alias to let

let "expression"

[[ expression ]]

See Bash - Conditional Expression

Expressions may be combined using the following operators, listed in decreasing order of precedence:

( expression )

Returns the value of expression. This may be used to override the normal precedence of operators.

Powered by ComboStrap