Created
December 12, 2016 15:32
-
-
Save djha-skin/193e55f718533830ef4db8814f780c86 to your computer and use it in GitHub Desktop.
Update alternatives in a directory
This file contains 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
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