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