# 执行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脚本。


---

# 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://valineliu.gitbook.io/deuterium-wiki/linux/awk-1/zhi-hang-awk-jiao-ben.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.
