# 使用 Homebrew, apk, apt, MacPorts, Nix 安装 goawk

查看 goawk 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:goawk
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install goawk
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install goawk
```

  证据: MacPorts ports tree: lang/goawk/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add goawk
```

  证据: Alpine Linux edge package indexes: goawk from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install goawk
```

  证据: Debian stable package indexes: goawk from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#goawk
```

  证据: nixpkgs package indexes: pkgs/by-name/go/goawk/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:goawk
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/goawk>
- **版本:** 1.31.0
- **来源摘要:** POSIX-compliant AWK interpreter written in Go
- **主页:** <https://benhoyt.com/writings/goawk/>
- **仓库:** <https://github.com/benhoyt/goawk>
- **上游文档:** <https://benhoyt.com/writings/goawk/>
- **许可证:** MIT
- **源码归档:** <https://github.com/benhoyt/goawk/archive/refs/tags/v1.31.0.tar.gz>
- **最后更新:** 2026-07-25T20:55:24-04:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- goawk (cli)
- goawk (别名)

## 构建依赖

- go

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.31.0
- 管理器更新时间: 2026-07-25
- 本地数据: OK
- 上游仓库: https://github.com/benhoyt/goawk
- 检测到的最新版本: v1.31.0 (当前)
## 项目历史与用法

GoAWK is Ben Hoyt's POSIX-compatible AWK interpreter written in Go, with command-line and embeddable library use cases. It began as a compact interpreter inspired by The AWK Programming Language and later grew CSV/TSV support, a bytecode virtual machine, code coverage, and an experimental AWK-to-Go compiler.

### 项目历史

The repository was created in June 2018, and the author's November 2018 article described GoAWK as an AWK interpreter written in Go, explaining its lexer, parser, resolver, tree-walking interpreter, testing, and performance work. The README says it is feature-complete and tested against the one true AWK and GNU AWK test suites.

GoAWK moved beyond the original tree-walking interpreter in the v1.15 era, when it switched to a bytecode compiler and virtual machine for better performance. In May 2022, the author added native CSV and TSV support, including CSV input/output modes and named fields, while keeping the project POSIX-compatible.

The project continued to add package-nerd features that ordinary awk implementations rarely expose, including embeddable Go APIs, code coverage support in v1.21.0, and the experimental AWKGo compiler.

### 采用历史

GoAWK is adopted as both a standalone awk-compatible command and an embeddable Go package. The README notes use in the Redpanda Connect stream processor and by the software team at the library of the University of Antwerp, the latter also sponsoring CSV work.

Distribution through Go modules, release binaries, Homebrew, Debian, MacPorts, Nix, and other package managers makes GoAWK a portable AWK option for users who want POSIX behavior, CSV-aware one-liners, or an AWK engine inside Go programs.

### 使用方式

As a CLI, GoAWK accepts ordinary awk programs and files, can be installed with go install, and supports CSV/TSV processing with -i and -o modes. As a library, Go programs can parse and execute AWK programs directly, reuse parsed programs, and configure interpreter behavior.

### 为什么软件包爱好者会关心

GoAWK matters because it connects two package cultures: the old Unix text-processing tradition of awk one-liners and the modern Go preference for single static binaries and embeddable packages. It is a practical example of reimplementing a standard Unix language with Go's parser, module, testing, and distribution ecosystem.

Its CSV support is especially notable because classic awk field splitting is convenient but not CSV-safe. GoAWK gives package users a drop-in-ish awk command that handles real CSV and TSV data while still aiming at POSIX AWK compatibility.

### 时间线

- 2018: The GoAWK repository was created and v1.0.0 was tagged.
- 2018: The author published the original GoAWK design and performance article.
- 2022: GoAWK adopted a bytecode compiler and virtual machine around the v1.15 release.
- 2022: GoAWK added native CSV and TSV support.
- 2022: GoAWK v1.21.0 added code coverage support.
- 2025: GoAWK v1.31.0 was tagged with minor fixes and a minimum Go version update.

### Related projects

- GoAWK is related to AWK, BWK awk, GNU Awk, POSIX awk, Redpanda Connect, the Go module ecosystem, and AWKGo, the experimental AWK-to-Go compiler included in the repository.

### 来源

- <https://benhoyt.com/writings/goawk-compiler-vm/>
- <https://benhoyt.com/writings/goawk-coverage/>
- <https://benhoyt.com/writings/goawk-csv/>
- <https://benhoyt.com/writings/goawk/>
- <https://github.com/benhoyt/goawk>
- <https://raw.githubusercontent.com/benhoyt/goawk/master/README.md>


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** goawk
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Debian apt - goawk - 1.29.0-1: normalized package name match | Debian stable package indexes: goawk from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | POSIX-compliant AWK interpreter written in Go, with CSV support (program) | https://github.com/benhoyt/goawk
- Debian apt - golang-github-benhoyt-goawk-dev - 1.29.0-1: normalized package name match | Debian stable package indexes: golang-github-benhoyt-goawk-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | POSIX-compliant AWK interpreter written in Go, with CSV support (library) | https://github.com/benhoyt/goawk
- Nix - goawk: normalized package name match | nixpkgs package indexes: pkgs/by-name/go/goawk/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - goawk - 1.30.1-r7: normalized package name match | Alpine Linux edge package indexes: goawk from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | POSIX-compliant AWK interpreter written in Go | https://github.com/benhoyt/goawk
- apk - goawk-doc - 1.30.1-r7: normalized package name match | Alpine Linux edge package indexes: goawk-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | POSIX-compliant AWK interpreter written in Go (documentation) | https://github.com/benhoyt/goawk
- MacPorts - goawk: normalized package name match | MacPorts ports tree: lang/goawk/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://pkg.so/zh-hans/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [go](https://pkg.so/zh-hans/brew/go/) - Build dependency declared by Homebrew.
- [mawk](https://pkg.so/zh-hans/brew/mawk/) - Shares pkgdb curated category or tags: awk, cli, interpreter, language-runtime.
- [yaegi](https://pkg.so/zh-hans/brew/yaegi/) - Shares pkgdb curated category or tags: cli, go, interpreter, language-runtime.
- [python@3.14](https://pkg.so/zh-hans/brew/python-3-14/) - Shares pkgdb curated category or tags: cli, interpreter, language-runtime.
- [python@3.13](https://pkg.so/zh-hans/brew/python-3-13/) - Shares pkgdb curated category or tags: cli, interpreter, language-runtime.
- [python@3.12](https://pkg.so/zh-hans/brew/python-3-12/) - Shares pkgdb curated category or tags: cli, interpreter, language-runtime.
- [ruby](https://pkg.so/zh-hans/brew/ruby/) - Shares pkgdb curated category or tags: cli, interpreter, language-runtime.
- [python@3.11](https://pkg.so/zh-hans/brew/python-3-11/) - Shares pkgdb curated category or tags: cli, interpreter, language-runtime.
- [rustpython](https://pkg.so/zh-hans/brew/rustpython/) - Local package facts share a topical domain. Shared terms: cli, interpreter, language, language-runtime, runtime.
- [three-body](https://pkg.so/zh-hans/brew/three-body/) - Local package facts share a topical domain. Shared terms: cli, interpreter, language, language-runtime, runtime.

## Combined YAML source

View the package source record on GitHub. [combined/goawk.yml](https://github.com/mxcl/pkgdb/blob/main/combined/goawk.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
