Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

If I have HTTP_PROXY defined in default my environment (by ~/.bash_profile), how can I unset the variable from a script?

I know that I can do unset HTTP_PROXY from the command line, but if I try to put this command in a script and run it, HTTP_PROXY is still defined. If I load the script using bash or source, it is still defined.

share|improve this question
3  
Could you post an example script? –  Jeremy Kerr Mar 2 '11 at 14:09

1 Answer 1

up vote 3 down vote accepted

When you run a script it will be executed in a separate child process which cannot affect the environment variables in the parent process (i.e. your interactive shell). However if you use the "source" command it will read lines from the script file and execute them in the current shell, so that should work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.