> For the complete documentation index, see [llms.txt](https://freebsdfrau.gitbook.io/serious-shell-programming/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://freebsdfrau.gitbook.io/serious-shell-programming/basics/control-flow.md).

# Control Flow

Allowing your code to make branching decisions, control flow requires a condition and makes a decision based on exit status of the conditional. shell offers a number of control flow elements.

* Binary Operators (`&&` and `||`)
* `if-elif-else` Statement
* `case` Statement
* `for` Loop
* `while` Loop
* Functions
