#!/bin/sh SOURCES_LIST="/etc/apt/sources.list" RELEASE_NAME="llx0709" DISTRO_NAME="lliurex" REG_EXP="^deb[[:blank:]]\+\(.*\)\/${DISTRO_NAME}\/\?[[:blank:]]\+${RELEASE_NAME}\([[:blank:]]\+.*\)*$" get_sources(){ sed -ne "s%${REG_EXP}%\1%p" ${SOURCES_LIST} |sort -mu } get_method(){ # http: / file: ... echo $1 |sed -ne "s%^\([[:alnum:]]\+\:\).*%\1%p" } get_path(){ echo $1 |sed -ne "s%^[[:alnum:]]\+\:\/*%%p" } # main exit 0