# 使用 Homebrew 安装 gsar

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

## 安装

```sh
sudo av install brew:gsar
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install gsar
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:gsar
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/gsar>
- **版本:** 1.51
- **来源摘要:** General Search And Replace on files
- **主页:** <https://tjaberg.com/>
- **上游文档:** <https://tjaberg.com/>
- **许可证:** GPL-2.0-only
- **源码归档:** <https://tjaberg.com/gsar151.zip>
- **已生成:** 2026-07-08T07:18:31+00:00

## 可执行文件

- gsar (cli)
- gsar (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## 版本和新鲜度

- 页面生成时间: 2026-07-08
- 管理器版本: 1.51
- 本地数据: OK
- 上游仓库: https://tjaberg.com/
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

gsar is Tormod Tjaberg and Hans Peter Verne's General Search And Replace utility, a command-line search-and-replace tool for text and binary files. Its official manual describes it as a binary-aware grep-like utility without regular-expression support, using a Boyer-Moore-derived search algorithm.

### 项目历史

The official source archive identifies the program as gsar 1.51 and credits Tormod Tjaberg and Hans Peter Verne for 1992-2020 copyright. The change log starts with early 1992 implementation work, followed by a sequence of DOS, Unix, compiler-portability, and buffer-handling releases.

The 1996 1.10 release was a major rewrite of the search and replace code, with easier Unix compilation, generated Boyer-Moore-Gosper tables at runtime, and safer handling of directories and buffers. Later releases were quieter maintenance updates, including MinGW support in 2002, larger search buffers and documentation cleanup in 2008, new text modifiers in 2019, and explicit 64-bit file offsets in 2020.

### 采用历史

The official homepage says the archive includes full source and DOS/Win32 executables, while most programs compile under Unix as well. Homebrew packages gsar as a small Unix-style command-line utility, which reflects its continued use as a portable binary search-and-replace tool rather than a large active ecosystem.

The homepage notes that gsar was selected as PriceLessWare 2006, indicating some Windows freeware-era recognition before its later package-manager life on Unix-like systems.

### 使用方式

gsar searches one or more input files, optionally replaces matches, can overwrite multiple files, and can operate as a stdin/stdout filter. The manual emphasizes binary-safe strings, byte offsets, hex entry, DOS-to-Unix and Unix-to-DOS conversion helpers, and context display.

Typical package-manager usage is for scripts or one-off maintenance where byte-oriented search and replace is needed without regular expressions, especially across binary files or files containing control characters.

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

gsar is package-nerd interesting because it is a compact old utility that still fills a sharp niche: binary-safe search and replacement with source available, no runtime dependency stack, and behavior stable enough for packaging.

Its long change log is a small history of portability work across DOS, Windows, Unix, MinGW, compiler quirks, large-file offsets, and command-line parsing, which is exactly the sort of maintenance package managers preserve for users who need the old tool to keep working.

### 时间线

- 1992: Official change log records main program and parser work.
- 1993: Version 1.05 implements filter mode and faster disk I/O.
- 1996: Version 1.10 rewrites search and replace code and improves Unix compilation.
- 2002: Version 1.11 adds MinGW support and ships a Win32 executable.
- 2008: Version 1.21 expands search and replace buffers and refreshes documentation.
- 2019: Version 1.50 adds wide-character and hexadecimal text modifiers.
- 2020: Version 1.51 adds explicit 64-bit file offsets.

### Related projects

- gsar sits near grep, sed, tr, binary patching tools, and small DOS/Unix text-processing utilities, but its official documentation emphasizes binary search and replace rather than line-oriented regular-expression processing.

### 来源

- <https://tjaberg.com/>
- <https://tjaberg.com/gsar151.zip>
- source_facts.description
- source_facts.package-manager


## 安全说明

generalized runtime or code generation signal.

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

## 源数据库详情

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


## 相关链接

- [Secret-risk packages](https://www.automicvault.com/zh-hans/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/zh-hans/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [grep](https://www.automicvault.com/zh-hans/pkg/brew/grep/) - Shares av.db curated category or tags: cli, developer-tools, search, text-processing.
- [align](https://www.automicvault.com/zh-hans/pkg/brew/align/) - Shares av.db curated category or tags: cli, developer-tools, text-processing.
- [bsdconv](https://www.automicvault.com/zh-hans/pkg/brew/bsdconv/) - Shares av.db curated category or tags: cli, developer-tools, text-processing.
- [cconv](https://www.automicvault.com/zh-hans/pkg/brew/cconv/) - Shares av.db curated category or tags: cli, developer-tools, text-processing.
- [cmigemo](https://www.automicvault.com/zh-hans/pkg/brew/cmigemo/) - Shares av.db curated category or tags: cli, developer-tools, text-processing.
- [decasify](https://www.automicvault.com/zh-hans/pkg/brew/decasify/) - Shares av.db curated category or tags: cli, developer-tools, text-processing.
- [desed](https://www.automicvault.com/zh-hans/pkg/brew/desed/) - Shares av.db curated category or tags: cli, developer-tools, text-processing.
- [enca](https://www.automicvault.com/zh-hans/pkg/brew/enca/) - Shares av.db curated category or tags: cli, developer-tools, text-processing.
- [rpl](https://www.automicvault.com/zh-hans/pkg/brew/rpl/) - Local package facts share a topical domain. Shared terms: cli, developer, developer-tools, files, processing.
- [sad](https://www.automicvault.com/zh-hans/pkg/brew/sad/) - Local package facts share a topical domain. Shared terms: cli, developer, developer-tools, processing, replace.

## Combined YAML source

View the package source record on GitHub. [combined/gsar.yml](https://github.com/automic-vault/db/blob/main/combined/gsar.yml)


## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- cross-ecosystem install command graph
