From 5f671849675b9573a83c7820af59ac446e965231 Mon Sep 17 00:00:00 2001 From: Aditya Date: Wed, 11 Jan 2023 15:47:22 +0530 Subject: [PATCH] Add 8.33 - Build grep --- scripts/chapter8/8.33-grep.sh | 27 +++++++++++++++++++++++++++ scripts/main.sh | 12 ++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 scripts/chapter8/8.33-grep.sh diff --git a/scripts/chapter8/8.33-grep.sh b/scripts/chapter8/8.33-grep.sh new file mode 100644 index 0000000..c464129 --- /dev/null +++ b/scripts/chapter8/8.33-grep.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +cd /sources +tar xf grep-3.7.tar.xz +cd grep-3.7 + +./configure --prefix=/usr + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] + +then + exit 1 +fi + +make check + +make install + +cd /sources +rm -rf grep-3.7 diff --git a/scripts/main.sh b/scripts/main.sh index 8435036..db8ce55 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -930,3 +930,15 @@ then stop_script "chapter8/8.32-bison.sh" fi +# Chapter 8.33 +# ============ +echo "Building grep" +su -c "bash $SCRIPT/chapter8/8.33-grep.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter8/8.33-grep.sh" +fi +