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

Re: exporting a variable to global shells



On Fri, May 11, 2007 at 08:53:18AM -0500, Ron Johnson wrote:
> 
> On 05/11/07 08:24, Jan-Florian Hilgenberg wrote:
> > Hi guy's, first I am german, so ignore my bad english please ;-)
> > 
> > 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
> > 
> [snip]
> > 
> > so, i think it is enaugh ;-)
> > I am really anxious for your answer and want to thank you for your help,
> > thank you ;-)
> 
> I don't think you *can* move environment variables "up the chain" on
> Unix-like systems.
> 

When I have a script that has to pass a variable to another unrelated
script, I use sort of a semaphore; echo the variable assignment to a
file in /tmp (which I have mounted on tmpfs so its fast) that can be
tested for existance and sourced if necessary by the other script.

There are probably better ways for IPC between scripts but this has
always seemed clean and simple.

Doug.



Reply to: