[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: exporting a variable to global shells



On Fri, 11 May 2007 15:24:46 +0200
"Jan-Florian Hilgenberg" <florianhilgenberg@googlemail.com> wrote:

> Hi guy's, first I am german, so ignore my bad english please ;-)

No problem. I assure you, it's a lot better than my German :-)

> 
> i want to get a variable out of a child shell in it parent shell, the
> sense is, that I want to use the ProxyServer of my school automaticly
> if it is pingable, the script isn't hard but the variable isn't fully
> global after exporting it
> 
> 
> my script:
> #!/bin/bash
> ping -c 1 192.168.4.4 && export http_proxy="192.168.4.4:8080"
> echo $http_proxy #for debugging
> 
> When the script is exiting the echo stdout's the proxy adress, but if
> I am back in my parent shell, the http_proxy variable is empty.
> The script should be run by the command post-up in the
> /etc/network/interfaces.

You could try adding the environment variable to /etc/environment (or
removing it, if appropriate). Then at least the environment variable
would be available to new login shells.

> And because it was so fair, i explain you an other problem.
> I have disabled the "auto" option for eth0 (ethernet) and eth1(wlan)
> because i change the network (home, school, work, friends...)
> continously and if there is no dhcp server or no cable in the
> ethernet(network/interface) then it needs a long time to bootup.
> But i wish that my System get a IP for ethernet on every bootup, I
> know there is the option to put a process in the background by
> "command &", where i have to change the option?

I don't know, but I suggest you use the guessnet or
network-manager packages instead.

> 
> so, i think it is enaugh ;-)
> I am really anxious for your answer and want to thank you for your
> help, thank you ;-)
> 
> bye

-- 

Liam



Reply to: