Created
July 14, 2016 11:42
-
-
Save vampy/09c1d57c6f834fef8d40cda36b8a5d75 to your computer and use it in GitHub Desktop.
Script to get all the PPA installed on a system
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 | |
# Script to get all the PPA installed on a system | |
for APT in `find /etc/apt/ -name \*.list`; do | |
grep -Po "(?<=^deb\s).*?(?=#|$)" $APT | while read ENTRY ; do | |
HOST=`echo $ENTRY | cut -d/ -f3` | |
USER=`echo $ENTRY | cut -d/ -f4` | |
PPA=`echo $ENTRY | cut -d/ -f5` | |
#echo sudo apt-add-repository ppa:$USER/$PPA | |
if [ "ppa.launchpad.net" = "$HOST" ]; then | |
echo ppa:$USER/$PPA | |
else | |
echo \'${ENTRY}\' | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment