# filename is based on URL, but first replace special characters in the URL with dots
filename="`echo "$1" | tr -s " ~!@#$%^&*()+=[]{}\\|;':<>?,./" "."`"
# put the file in the /tmp directory (or any directory of your choosing), as defined below
tempdir="/tmp"
filepath="$tempdir/$filename.htm"
# create the quick HTML required for the download link
link="<html><head><title>Download link for $1</title></head><body><a href=\"$1\">$1</a></body></html>"
# write the download link HTML to the temporary file
echo $link > $filepath
# launch the file with the link
open $filepath
And you're done!