Skip to content

Instantly share code, notes, and snippets.

@jubecker
Last active January 2, 2016 18:13
Show Gist options
  • Save jubecker/0fc7eb90dd3d98682068 to your computer and use it in GitHub Desktop.
Save jubecker/0fc7eb90dd3d98682068 to your computer and use it in GitHub Desktop.
bash 4.3 update
#!/bin/sh
BASE_VERSION="bash-4.3"
MAX_PATCH=42
BASE_URL="http://ftp.gnu.org/gnu/bash"
PATCHES_URL="${BASE_URL}/${BASE_VERSION}-patches"
ARC="${BASE_VERSION}.tar.gz"
rm -rf ${BASE_VERSION}
if [ ! -f $ARC ]
then
echo "downloading $ARC ..."
curl -s -O ${BASE_URL}/${ARC}
fi
tar xfz $ARC
for i in $(seq -f "%03g" 1 $MAX_PATCH)
do
ptch="bash43-$i"
if [ ! -f $ptch ]
then
echo "downloading $ptch ..."
curl -s -O "${PATCHES_URL}/$ptch"
fi
done
cd ${BASE_VERSION}
for i in $(seq -f "%03g" 1 $MAX_PATCH)
do
ptch="bash43-$i"
echo "applying $ptch ..."
patch -p0 < ../$ptch
done
CFLAGS="-O3" ./configure --prefix=/opt/${BASE_VERSION}.${MAX_PATCH}
make -j4
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment