#!/bin/bash set -e acceptList=( http://rp9.win98.nl/RP9/RP9Updates.exe http://rp9.win98.nl/RP9/RP-9.1.0.exe http://www.baut.nl/downloads/RP9-Icons.zip http://rp9.win98.nl/IE6-UK.zip http://rp9.win98.nl/FireFox/Firefox-Setup-2.0.0.4-US.exe http://rp9.win98.nl/install_flash_player-9.0.47.exe http://rp9.win98.nl/FileZilla_2_2_3.zip http://rp9.win98.nl/VNC_X86_WIN32.zip http://rp9.win98.nl/seamonkey-1.1.18.en-US.win32.installer.exe ) test "${#acceptList[@]}" -gt 0 accept="($(regex-quote.sh "${acceptList[0]}")" for (( i = 1; i < "${#acceptList[@]}"; ++i )) ; do accept+="|$(regex-quote.sh "${acceptList[${i}]}")" done accept+=")" cat <<< "${accept}" wget -r -l 1 -p --convert-links --span-hosts --regex-type=pcre --accept-regex="${accept}" http://rp9.win98.nl/ "${@}"