Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7561963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:17:42+00:00 2026-05-30T13:17:42+00:00

In linux we can change the variable of http_proxy in terminal by export http_proxy=http://x.x.x.x:x

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:17:43+00:00Added an answer on May 30, 2026 at 1:17 pm

    You can change the script to embed wget call, assuming a new file containing urls:

    #!/bin/bash
    
    URLS="_url_list.txt"
    FILE="_reliable_list.txt"
    
    i=1
    for line in $(cat $FILE)
    do
        export http_proxy="http://$line"
        wget $(head $i $URLS | tail -1 | tr -d '\n')
        let i++
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to find a linux command that can return a part of the
We have a C application for Linux consisting of few modules. Each module can
I have found several similar answers but I can't quite get why this is
Possible Duplicate: How to read Linux environment variables in c++ How can the following
hello every one i want to ask that i have read that we can
In FreeBSD/Linux, the ICMPv4/v6 Redirect pkt can be received by the OS, but the
In Linux I can view or change the ephemeral port range using the /proc/sys/net/ipv4/ip_local_port_range
I have a database (Mysql) with some fields in UTF-8 (I can change that
Currently In my embedded linux I can not open multiple ALSA sound stream. What
Is there a command like cat in linux which can return a specified quantity

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.