Andrew's git
/
scripts.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
add line-commenting feature to nameget.sh
author
Andrew Lorimer
<andrew@charles.cortex>
Tue, 19 Nov 2019 06:12:26 +0000
(17:12 +1100)
committer
Andrew Lorimer
<andrew@charles.cortex>
Tue, 19 Nov 2019 06:12:26 +0000
(17:12 +1100)
nameget.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2c69d15
)
diff --git
a/nameget.sh
b/nameget.sh
index 43016dac8a38c17d60db3b531fdedb28f45c2239..bb3d2a1ce27ff99f7c6742683ea02efbc49986a8 100755
(executable)
--- 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
\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
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
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
# parse output filename
destarg='' # placeholder for -O argument (output filename)
if [ -z "$filename" ] || [ "filename" = "" ]; then