grep - Print lines matching a pattern ChangeLog

HOWTO


# GNU grep 3.11
# =============
# Slackware 14.0, 14.1: grep 2.14
# Slackware 14.2: grep 2.25
# Slackware 15.0: grep 3.7

# Prerequisites:
# glibc's iconv or libiconv
# pkg-config >= 0.9.0
# Perl >= 5.005
# gettext (if you don't use --disable-nls)
# PCRE or PCRE2

# If you have any trouble with the download URL used below:
# https://ftp.gnu.org/gnu/grep/
# https://ftpmirror.gnu.org/grep/ (automatic redirect)
# https://www.gnu.org/prep/ftp.html (GNU mirrors)

# info-gnu: grep-3.11 released [stable]
# Savannah: grep-3.11 released [stable]
# Documentation for Grep
# bug-grep mailing list (bugs, development, etc.)
# info-gnu mailing list (GNU release announcements)

# Get the source tarball
cd
test -f installed/grep-3.11.tar.xz && mv installed/grep-3.11.tar.xz .
test ! -f grep-3.11.tar.xz &&
wget http://ftpmirror.gnu.org/grep/grep-3.11.tar.xz

# Verify tarball w/ sha256sum:
# (this came from the info-gnu/Savannah release announcement)
# Either requires cksum from coreutils >= 9.2 or you have to do some
# extra handling because the checksum is base64 encoded
# HbKu3eidDepCsW2VKPiUyNFdrk4ZC1muzHj1qVEnbqs=
# ->
# sha256sum grep-3.11.tar.xz | xxd -r -p | base64
# -or-
# shasum -a 256 grep-3.11.tar.xz | xxd -r -p | base64
# -or-
# openssl sha256 -binary grep-3.11.tar.xz | openssl base64
# ->
echo "1db2aedde89d0dea42b16d9528f894c8d15dae4e190b59aecc78f5a951276e\
ab  grep-3.11.tar.xz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 000BEEEE > /dev/null 2>&1 || gpg --recv-keys 000BEEEE ) &&
wget -nc http://ftpmirror.gnu.org/grep/grep-3.11.tar.xz.sig &&
  gpg --verify grep-3.11.tar.xz.sig && rm grep-3.11.tar.xz.sig

# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "grep-*" -exec rm -r {} \;
tar xJvf ~/grep-3.11.tar.xz
cd grep-3.11
test $UID = 0 && chown -R root:root .

# I use --disable-nls because I only read/write English (well), if
# that is not the case for you, leave that off

# Configure the build
./configure --bindir=/bin --prefix=/usr --infodir=/usr/info \
--mandir=/usr/man --disable-nls

# Build it
make

# Become root to install it
su

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg grep

# Clean up old files
( cd /usr/bin ; rm -f egrep fgrep grep )
( cd /bin ; rm -f egrep fgrep grep )
find /usr/share/locale -name grep.mo -exec rm {} \;

# Install it, create symlinks
make install
ln -sf /bin/egrep /usr/bin/egrep
ln -sf /bin/fgrep /usr/bin/fgrep
ln -sf /bin/grep /usr/bin/grep

# /bin/egrep and /bin/fgrep are small scripts
# If you do not want to see these messages every time you run them:
#   warning: egrep is obsolescent; using grep -E
#   warning: fgrep is obsolescent; using grep -F
# ...either update all of your scripts to use 'grep -E' or 'grep -F', or
# replace egrep and fgrep with symbolic links to /bin/grep
# ln -sf /bin/grep /bin/egrep
# ln -sf /bin/grep /bin/fgrep

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/grep-*.tar.*
mv grep-3.11.tar.xz installed/


# If you ever want to uninstall grep (why?), this should do it:
cd
su
test -d src/grep-* && ( cd src/grep-* ; make uninstall )
( cd /bin ; rm -f egrep fgrep grep )
( cd /usr/bin ; rm -f egrep fgrep grep )
test -d /usr/doc/grep && rm -r /usr/doc/grep
find /usr/doc -mindepth 1 -type d -name "grep-*" -exec rm -r {} \;
( cd /usr/man/man1 ; rm -f grep.1 fgrep.1 egrep.1 )
( cd /usr/share/man/man1 ; rm -f grep.1 fgrep.1 egrep.1 )
rm -f /usr/info/grep.info /usr/share/info/grep.info
exit
find ~/src -maxdepth 1 -type d -name "grep-*" -exec rm -r {} \;
rm -f ~/installed/grep-*.tar.*

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EDT -0400)
HOWTO last updated: 2024-02-11 3:29pm
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]