Skip to content

Instantly share code, notes, and snippets.

@kakkun61
Created February 1, 2018 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kakkun61/6d6c48ff0891c8bd705c436a96727e4b to your computer and use it in GitHub Desktop.
Save kakkun61/6d6c48ff0891c8bd705c436a96727e4b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
GCC_PATH=/usr/local/bin/gcc
usage() {
echo "$(basename $0) [fsf/apple]" >&2
}
if [[ $# -ne 1 ]]
then
usage
exit 1
fi
if [[ -L $GCC_PATH ]]
then
rm $GCC_PATH
fi
case "$1" in
fsf)
ln -s /usr/local/bin/gcc-7 $GCC_PATH
exit 0
;;
apple)
ln -s /usr/bin/gcc $GCC_PATH
exit 0
;;
esac
echo 'bad parameter' >&2
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment