From 550ec57c321aca0b664afc41ba453fcbcbe156e9 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 13 Jul 2018 15:15:00 +0200 Subject: buff-di-wuff: correct prefix --- buff-di-wuff | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/buff-di-wuff b/buff-di-wuff index c86965f..7cbe7cc 100755 --- a/buff-di-wuff +++ b/buff-di-wuff @@ -20,6 +20,9 @@ grep '^[^#]' "$(dirname "$0")/downloads.list" | \ printf '%s\n' "${url}" | \ sed 's|/[^/]*$|/|' ) + urlPrefix="${urlDir}" + else + urlPrefix="${url%/*}/" fi urlFile=$( printf '%s\n' "${url}" | \ @@ -33,7 +36,7 @@ grep '^[^#]' "$(dirname "$0")/downloads.list" | \ tr '"<>/' '\n' | \ grep "^${urlFile}\$" | \ sort -u | \ - xargs -r printf "${urlDir}%s\n" + xargs -r printf "${urlPrefix}%s\n" else printf '%s\n' "${url}" fi -- cgit v1.2.3-70-g09d2