From: Andrew Lorimer Date: Tue, 19 Nov 2019 06:12:26 +0000 (+1100) Subject: add line-commenting feature to nameget.sh X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/d220e3360de621b6b6a699de6ddc10e6cac29cca?ds=inline;hp=--cc add line-commenting feature to nameget.sh --- d220e3360de621b6b6a699de6ddc10e6cac29cca 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