Re: SQR or SQL*PLUS and enviroment variables + UNIX
Date: 1995/08/17
Message-ID: <40utcd$j1e_at_cs3.brookes.ac.uk>#1/1
In article <40s6f2$o9h_at_aggedor.rmit.EDU.AU>, David T. Bath says...
>p0070621_at_brookes.ac.uk (Tommy Wareing) writes:
>>In article <4083dm$ji5_at_bigboote.WPI.EDU>, KJ says...
>>> Does anyone know how in a Unix enviorment how I can change an
>>>envoirment variable that existed when it was caled. I know that getenv()
>>>can be used to read them , but how about changing them?
>>man getenv
>>...
>> SEE ALSO
>> exec(2), putenv(3C), environ(5)
>> ^^^^^^^^^^
>>But of course, you can't pass them back up to a parent process.
>Unless you are using sh/ksh
> FRED=`process_that_echoes_new_value`
>OR
> do some sniffy reading by parent/writing by child along
> a named pipe, or some other IPC mechanism and then get
> the parent to write to ITS environment. If you are
> coding in C, this is not too difficult.
Which isn't passing environment variables up to the parent. It's sending some string to some stream, and hoping that the parent picks it up.
eg. if FRED=`process_that_echoes_new_value`, and the child wants to change JIM, it's a bit stuffed. (But if this works, it'll also work under C-shell type shells: setenv FRED `process_that_echoes_new_value`).
-- _________________________ __________________________________________ / Tommy Wareing \ / I've been looking for an original sin, \ | p0070621_at_brookes.ac.uk X One with a twist and a bit of a spin | \ 0865-483389 / \ -- Pandora's Box, Jim Steinman / ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Received on Thu Aug 17 1995 - 00:00:00 CEST