diff options
author | Nick White <git@njw.name> | 2015-05-21 13:11:15 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2015-05-21 13:11:15 +0100 |
commit | 3df96c167365444adf5d1c7c9217a632fd023903 (patch) | |
tree | 89012acfa11e15fea916097f4907d7192145d842 /pull-images | |
parent | 7a0d5cba3fba1858b8b70f05ce017b0e46cb4bdc (diff) | |
download | tkread-3df96c167365444adf5d1c7c9217a632fd023903.tar.bz2 tkread-3df96c167365444adf5d1c7c9217a632fd023903.zip |
Improved pull-images script
Diffstat (limited to 'pull-images')
-rwxr-xr-x | pull-images | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pull-images b/pull-images index 57ed567..fd864bc 100755 --- a/pull-images +++ b/pull-images @@ -7,11 +7,13 @@ test $# -gt 2 && echo "$usage" && exit 1 imgurls=`cat "$1" \ | awk -F \( '/!\[[^\]]*\]\([^\)]*\)/ {print $2}' \ -| sed 's/)\]$//' \ -| awk '{print $1}'` +| sed 's/).*//' \ +| awk '{print $1}' \ +| sort | uniq` for i in $imgurls; do echo "$i" | grep -q '//' test $? -ne 0 && i="${2}${i}" - wget "$i" + echo "Downloading $i" + wget -q "$i" done |