Created
February 6, 2016 15:48
-
-
Save guziy/ddc849ef1a65a784eddb to your computer and use it in GitHub Desktop.
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
#! /bin/bash | |
# exit on error | |
set -e | |
the_list=($( port installed | grep -v active | grep -v : )) | |
size=${#the_list[@]} | |
let size=$size-1 | |
echo $size | |
for ((i=0; i < size; i+=2)) | |
do | |
sudo port uninstall ${the_list[i]} ${the_list[i+1]} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes it has to be executed several times (removing
set -e
), since it is not smart enough to uninstall dependant before the dependencies)). Or mannually delete the dependents and restart the script.