#!/bin/bash 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 deb ${ENTRY} done done