> For the complete documentation index, see [llms.txt](https://valineliu.gitbook.io/deuterium-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valineliu.gitbook.io/deuterium-wiki/linux/awk-1/zhi-hang-awk-jiao-ben.md).

# 执行awk脚本

平时使用awk进行文本处理的时候，有一些命令比较常用，为了方便以后使用，可以将命令保存在文件中。

比如：

{% code title="begin.awk" %}

```bash
#! /usr/bin/awk -f
BEGIN {print "Learn awk.\nDon't Panic!"}
```

{% endcode %}

执行的时候就可以这样了：

```bash
awk -f begin.awk
```

其中-f就是指定要执行的awk脚本。
