I\'m trying to knock together a little batch script for downloading files, that takes a URL as its first parameter and a local filename as its second parameter. In testing
I agree with cms. Quoting the input arguments correctly is much better style - what will you do with the next problem character? The following is much better.
curl -# -C - -o "$2" $1
However, I hate people not answering the asked question, so here's an answer :-)
#!/bin/bash
clear
echo Downloading $1
echo
filename=`echo $2 | sed -e "s/ /\\\ /g"`
echo $filename
echo eval curl -# -C - -o $filename $1