Skip to content

Instantly share code, notes, and snippets.

@PhilGeek
Created February 2, 2009 00:24
Show Gist options
  • Save PhilGeek/56708 to your computer and use it in GitHub Desktop.
Save PhilGeek/56708 to your computer and use it in GitHub Desktop.
Install GNU awk
#!/bin/sh
#
# installgawk.sh
#
# A bash script to install the latest version of GNU awk. Be sure to set the variables to the desired values.
#
# http://www.gnu.org/software/gawk/
#
# Mark Eli Kalderon 2008-03-22
# Gawk. Change to the desired version if necessary
VER="3.1.6"
GAWK="gawk-${VER}"
# Build directories. Change to the desired directories if necessary.
GBLDDIR=/var/tmp/${GAWK}-build
# Create gawk build directory, but save source files if they exist.
test -d ${GBLDDIR} || mkdir ${GBLDDIR}
test -d ${GBLDDIR}/${GAWK} && /bin/rm -rf ${GBLDDIR}/${GAWK}
cd $GBLDDIR
# Download and unpack gawk source.
curl http://ftp.gnu.org/gnu/gawk/${GAWK}.tar.gz -O
tar -xvzf ${GAWK}.tar.gz
cd ${GAWK}
# Configure and build gawk.
./configure
make
make check
# Install gawk (in /usr/local/bin/). Will prompt for password.
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment