1#! /bin/bash
23
# get urls from duckduckgo, then parse them to wget to download
45
args=("$@")
6search=${args[0]}
7filetype=${args[1]}
89
set -f
10urls=`curl -silent https://duckduckgo.com/html/\?q\=site:www.mash.dept.shef.ac.uk/Resources |
11grep 'pdf$' | tr -d ' \t\r' | grep -v '^[0-9]' | awk '{print "http://" $0}'`
1213
for url in $urls; do
14wget --cut-dirs=100 -P /mnt/andrew/literature/mathcentre/ $url
15done