Skip to content

Instantly share code, notes, and snippets.

@hsupu
Last active November 5, 2019 09:26
Show Gist options
  • Save hsupu/55a6b583c5249bfe738cc773fa422de9 to your computer and use it in GitHub Desktop.
Save hsupu/55a6b583c5249bfe738cc773fa422de9 to your computer and use it in GitHub Desktop.
alternatives with java
#!/usr/bin/env bash
SDIR=/usr/bin
DDIR=/usr/bin
VER=$1
PRIOR=$2
update-alternatives --install $DDIR/gcc gcc $SDIR/gcc-$VER $PRIOR \
--slave $DDIR/gcc-ar gcc-ar $SDIR/gcc-ar-$VER \
--slave $DDIR/gcc-nm gcc-nm $SDIR/gcc-nm-$VER \
--slave $DDIR/gcc-ranlib gcc-ranlib $SDIR/gcc-ranlib-$VER
update-alternatives --install $DDIR/gcov gcov $SDIR/gcov-$VER $PRIOR \
--slave $DDIR/gcov-dump gcov-dump $SDIR/gcov-dump-$VER \
--slave $DDIR/gcov-tool gcov-tool $SDIR/gcov-tool-$VER
update-alternatives --install $DDIR/cpp cpp $SDIR/cpp-$VER $PRIOR
update-alternatives --install $DDIR/g++ g++ $SDIR/g++-$VER $PRIOR
update-alternatives --set cc /usr/bin/gcc
update-alternatives --set c++ /usr/bin/g++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment