In linux we can change the variable of http_proxy in terminal by export http_proxy=http://x.x.x.x:x. But I want to do it with script. So I have following code:
#!/bin/bash
FILE="_reliable_list.txt"
for line in $(cat $FILE)
do
proxy="http://$line"
export http_proxy=$proxy
done
At the end on the same terminal when I check the value of variable http_proxy, it is null.
I want to read from file proxy addresses and export them to http_proxy variable, and after use it with wget. Simply I want to automate this code:
export http_proxy=http://x.x.x.x:x
wget mysite.com
If any other ideas I will be very glad.
You can change the script to embed wget call, assuming a new file containing urls: