# 安装使用GNU sed

macOS中的sed语法和GNU sed不同，使用不习惯，也需要改脚本。所以通过brew安装GNU sed

```
brew install gnu-sed --with-default-names
```

安装以后需要根据提示加入路径，这样就可以默认使用GNU sed

```
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
```

## 参考

* [How to use GNU sed on Mac OS X](https://stackoverflow.com/questions/30003570/how-to-use-gnu-sed-on-mac-os-x)


---

# 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://huataihuang.gitbook.io/cloud-atlas-draft/develop/mac/gnu_sed.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.
