6.35. Grep-2.5.4

The Grep package contains programs for searching through files.

6.35.1. Environment Settings

This package requires compiler variables to be set for the target in the environment.

export CC="${CLFS_TARGET}-gcc"
export CXX="${CLFS_TARGET}-g++"
export AR="${CLFS_TARGET}-ar"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
export LD="${CLFS_TARGET}-ld"
export STRIP="${CLFS_TARGET}-strip"

6.35.2. Installation of Grep

This patch adds support for Internationalization:

patch -Np1 -i ../grep-2.5.4-i18n-1.patch

Prepare Grep for compilation:

./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --prefix=/usr --bindir=/bin --disable-perl-regexp

Compile the package:

make

Install the package:

make DESTDIR=${CLFS} install

6.35.3. Contents of Grep

Installed programs: egrep (link to grep), fgrep (link to grep), and grep

Short Descriptions

egrep

Prints lines matching an extended regular expression

fgrep

Prints lines matching a list of fixed strings

grep

Prints lines matching a basic regular expression