Skip to content

Instantly share code, notes, and snippets.

@norio-nomura
Last active April 17, 2018 02:28
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 norio-nomura/505e5a5dce1502c774db51c9e3663700 to your computer and use it in GitHub Desktop.
Save norio-nomura/505e5a5dce1502c774db51c9e3663700 to your computer and use it in GitHub Desktop.
[one-liner] update-alternatives for llvm on ubuntu
LLVM_VERSION=`cd /usr/bin; ls llvm-config-*|sed 's/llvm-config-//'` && \
(cd /usr/bin; ls -1 llvm*-$LLVM_VERSION) | sed -e '/llvm-config/d' -e "s/-$LLVM_VERSION//"| \
awk -v LLVM_VERSION=$LLVM_VERSION 'BEGIN{print "update-alternatives --force --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-"LLVM_VERSION" 200 \\"}{print "--slave /usr/bin/"$0, $0, "/usr/bin/"$0"-"LLVM_VERSION" \\" }'|sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment