From d220e3360de621b6b6a699de6ddc10e6cac29cca Mon Sep 17 00:00:00 2001 From: Andrew Lorimer Date: Tue, 19 Nov 2019 17:12:26 +1100 Subject: [PATCH] add line-commenting feature to nameget.sh --- nameget.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nameget.sh b/nameget.sh index 43016da..bb3d2a1 100755 --- a/nameget.sh +++ b/nameget.sh @@ -27,7 +27,7 @@ Get a list of urls and optional corresponding output paths, then send them to wg \e[1mOPTIONS:\e[0m -l, --list - Text file where each line contains a url and filename separated by a space. Filename is optional. + Text file where each line contains a url and filename separated by a space. Filename is optional. Lines starting with # are ignored. Default: ./queue.txt -h, --help @@ -127,6 +127,9 @@ output "Starting downloading files in $(readlink -f $list) to $outdir" "\n\e[1m" while read -r url filename; do + # Ignore if line is commented + [[ "$url" =~ ^\s*#.* ]] && continue + # parse output filename destarg='' # placeholder for -O argument (output filename) if [ -z "$filename" ] || [ "filename" = "" ]; then -- 2.47.1