> For the complete documentation index, see [llms.txt](https://linux-in-action.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://linux-in-action.gitbook.io/project/shell-bian-cheng.md).

# Shell 编程

shell 脚本和 shell 交互式命令行的主要区别在于可以**输入多个命令并处理每个命令的结果，甚至需要将一个命令的结果传给另一个命令**。

当然，你可以把这些命令放在同一行中，彼此之间用分号隔开。但是这非常不方便，因此我们可以将命令组合成一个简单的文本文件，每次需要运行这些命令时，只要运行这个文本文件就可以了。
