wget -e use_proxy=yes -e http_proxy=$proxy http://askubuntu.com
Here is what the above code is Doing:
1. We are using the wget command to download the file.
2. The -e use_proxy=yes part tells wget that it will be using a proxy, and the -e http_proxy=$proxy tells wget the address for the proxy.
3. The last part of the command is the address of the file we want to download.