2023-04-16 10:04:24 +02:00
|
|
|
# Bash compound commands
|
|
|
|
|
|
|
|
The main part of Bash's syntax are the so-called **compound commands**.
|
|
|
|
They're called like that because they use "real" commands ([simple
|
2023-04-24 13:31:29 +02:00
|
|
|
commands](/syntax/basicgrammar.md#simple_commands) or
|
|
|
|
[lists](/syntax/basicgrammar.md#lists)) and knit some intelligence around
|
2023-04-16 10:04:24 +02:00
|
|
|
them. That is what the essential "Bash language" is made of.
|
|
|
|
|
|
|
|
## Command grouping
|
|
|
|
|
|
|
|
- grouping: [command grouping](grouping_plain)
|
|
|
|
- grouping again: [command grouping in a subshell](grouping_subshell)
|
|
|
|
|
|
|
|
## Conditional reactions
|
|
|
|
|
|
|
|
Note that conditionals can also be scripted using
|
2023-04-24 13:31:29 +02:00
|
|
|
[list](/syntax/basicgrammar.md#lists), which are syntax elements, not
|
2023-04-16 10:04:24 +02:00
|
|
|
commands.
|
|
|
|
|
|
|
|
- the "new" test command: [conditional
|
|
|
|
expression](conditional_expression)
|
|
|
|
- if-clause: [conditional branching](if_clause)
|
|
|
|
- case statement: [pattern-based branching](case)
|
|
|
|
|
|
|
|
## Loops
|
|
|
|
|
|
|
|
- [classic for-loop](classic_for)
|
|
|
|
- [C-style for-loop](c_for)
|
|
|
|
- [while loop](while_loop)
|
|
|
|
- [until loop](until_loop)
|
|
|
|
|
|
|
|
## Misc
|
|
|
|
|
|
|
|
- math: [arithmetic evaluation](arithmetic_eval)
|