6.39. Grep-2.5.3

The Grep package contains programs for searching through files.

Approximate build time: 0.1 SBU
Required disk space: 7.2 MB

6.39.1. Installation of Grep

The current Grep package has many bugs, especially in the support of multibyte locales. The following consolidated patch from Debian fixes some of them, improves the number of individual tests which are passed, and much improves the speed in UTF-8 locales:

patch -Np1 -i ../grep-2.5.3-debian_fixes-1.patch

Upstream have fixed some of the documentation, and changed some of the tests and the expected results in the newest test scripts. This means that not so many of the individual tests fail:

patch -Np1 -i ../grep-2.5.3-upstream_fixes-1.patch

Prepare Grep for compilation:

./configure --prefix=/usr \
    --bindir=/bin \

The meaning of the configure switch:


The configure check for glibc's regex library is broken when building against glibc-2.8. This switch forces the use of glibc's regex library.

Compile the package:


To test the results, issue:

make check || true

There are known test failures in the foad1.sh and fmbtest.sh tests. The "|| true" construct is used to avoid build automated build scripts failing due to the test failures. A good run will show 2 failures from 14 tests, but if you look at the output you will see in excess of forty individual tests which failed - these are all in the new tests added since the previous version.

Install the package:

make install

6.39.2. Contents of Grep

Installed programs: egrep, fgrep, and grep

Short Descriptions


Prints lines matching an extended regular expression


Prints lines matching a list of fixed strings


Prints lines matching a basic regular expression