Skip to content

Instantly share code, notes, and snippets.

@djhaskin987
Created December 12, 2016 15:32
Show Gist options
  • Save djhaskin987/193e55f718533830ef4db8814f780c86 to your computer and use it in GitHub Desktop.
Save djhaskin987/193e55f718533830ef4db8814f780c86 to your computer and use it in GitHub Desktop.
Update alternatives in a directory
set -x
dir="${1}"
for i in $(ls -1A $dir)
do
if [ -x ${dir}/${i} ]
then
update-alternatives --install /usr/bin/${i} ${i} ${dir}/${i} 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment