# 11. 循环与分支

> 奥赛罗夫人，您为什么把这句话说了又说呢？
>
> —— 《奥赛罗》，莎士比亚

## 本章目录

* [11.1 循环](/shell/part3/11_loops_and_branches/11_1_loops.md)
* [11.2 嵌套循环](/shell/part3/11_loops_and_branches/11_2_nested_loops.md)
* [11.3 循环控制](/shell/part3/11_loops_and_branches/11_3_loop_control.md)
* [11.4 测试与分支](/shell/part3/11_loops_and_branches/11_4_testing_and_branching.md)

对代码块的处理是结构化和构建 shell 脚本的关键。循环与分支结构恰好提供了这样一种对代码块处理的工具。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.clay-wangzhi.com/shell/part3/11_loops_and_branches.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
