Created
May 16, 2017 22:20
-
-
Save mwinters-stuff/ef2d7379eac0feffbae12be10eff009c to your computer and use it in GitHub Desktop.
Small script for creating missing alternatives for gcc/g++ and clang/clang++ in ubuntu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ALTS="gcc g++ clang clang++" | |
for VAR in $ALTS | |
do | |
echo $VAR | |
update-alternatives --remove-all $VAR | |
FOUND=`find /usr/bin -name $VAR-* -print | grep $VAR-[0-9] | sort` | |
C=10 | |
for FF in $FOUND | |
do | |
echo $C $FF | |
update-alternatives --install /usr/bin/$VAR $VAR $FF $C | |
C=$((C + 10)) | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment