PDA

View Full Version : Dynamic ENVironment VARiables?



yr2alex
28th March 2006, 06:29 PM
I use Fedora 5 on a network that is firewalled and requires proxy access to external network. Having said that, in order for me to use YUM I must do the following:


http_proxy=http://userid:passwd@ipaddress:port/

next to commit new variable I do the following:


export http_proxy

finally to ensure that the new variable was entered correctly I do the following:


env

which reveals that the previous actions were preformed correctly. A quick "yum install <application>" (http://www.fedoraforum.org/gallery/showimage.php?i=1949) confirms this. Everthing is working perfectly in that regard; howvwer, I find that I must perform this operation every single time I want to install/update packages via YUM without failure. My question is simply, should not the entries that are explicitly written to the ENV VAR be static? If not how do I make them static?

yr2alex

P.S. please forgive me for asking a redundant question if in fact the question has been asked and answered previously.

Jman
29th March 2006, 04:10 AM
Do this:
echo "export http_proxy=http://userid:passwd@ipaddress:port/" >> ~/.bashrc This puts the line in your bash startup file, so every time you login it gets set.

And no environment variables aren't automatically saved across shell sessions.

yr2alex
29th March 2006, 04:35 PM
Thanks for the assist Jman.

yr2alex

Al3xanR0
28th April 2006, 07:53 PM
Do this:
echo "export http_proxy=http://userid:passwd@ipaddress:port/" >> ~/.bashrc This puts the line in your bash startup file, so every time you login it gets set.

And no environment variables aren't automatically saved across shell sessions.

Isn't it wonderful how you can (sometimes) get the answer to a question without even posting?
Just one question for you there Jman, should this be done with or with out the "" (quotation marks)?

TIA

Mat
28th April 2006, 07:58 PM
you need the quotes, because there's an whitespace between export and http_proxy



Mat

Al3xanR0
28th April 2006, 08:11 PM
you need the quotes, because there's an whitespace between export and http_proxy



Mat

Thanks for the assist Mat. :D