> 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脚本。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://valineliu.gitbook.io/deuterium-wiki/linux/awk-1/zhi-hang-awk-jiao-ben.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
