This is where I have got up to in searching for the solution: 1) Fix sed statement to extract protocol in get_downloadclient() local proto=$(echo "$url" | sed 's|://.*||') 2) escape ampersands in netfile in get_downloadcmd() local netfile=$(echo "$2" | sed "s|\&|\\\&|g") Then $dlcmd get created correctly but running the following messages at the end of get_downloadcmd() shows what is happening... plain "$dlcmd" /usr/bin/wget -c -t 3 --waitretry=3 -O mythplugins-0.21.tar.bz2.part http://www.mythtv.org/modules.php?name=Downloads&d_op=getit&lid=136&foo=/mythplugins-0.21.tar.bz2 plain "$(echo $dlcmd)" /usr/bin/wget -c -t 3 --waitretry=3 -O mythplugins-0.21.tar.bz2.part So this does not pass the url to the actual wget call, which explains the "wget: missing URL" error message I am left with. Note that once that is fixed, the ampersands in the url need escaped again for the wget command to actually work. I need sleep so I leave it to people in a more appropriate time zones to find a solution. :) Allan