8.38 Grep-3.12

Grep 软件包包含用于在文件内容中搜索的程序。

Approximate build time: 0.5 SBU
Required disk space: 48 MB

8.38.1 Grep 的安装

首先,移除关于使用 egrep 和 fgrep 的警告,该警告会导致某些软件包的测试失败:

sed -i "s/echo/#echo/" src/egrep.sh

准备编译 Grep:

./configure --prefix=/usr

编译该软件包:

make

要测试结果,请运行:

make check

安装该软件包:

make install

8.38.2 Contents of Grep

Installed programs: egrep, fgrep, and grep

Short Descriptions

egrep

打印匹配扩展正则表达式的行。它已过时,请改用 grep -E

fgrep

打印匹配固定字符串列表的行。它已过时,请改用 grep -F

grep

打印匹配基本正则表达式的行