[H-GEN] Reading from and writing to, environment variable from PERL

Andrae Muys andrae.muys at braintree.com.au
Wed Sep 10 00:15:22 EDT 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

Cunningham, Conor wrote:
> I am writing some scripts at work, to go into a ~/bin dir full of tools.
> This tool will take a date which is stored in a local/environment var
> called $data_period, in the format yyyy-mm-dd.
> 
> It will then, depending on parameters, output the date per the users
> wishes. i.e. yyyymm.
> 

1) I'm pretty sure there is already a unix utility that does this, so 
you might want to check your man pages (or just wait for Mark/Greg to 
pipe-up with the answer ;).

> Or alternatively, access and overwrite the local/environment variable
> directly from my shell script?

This isn't possible.  Child processes have no access to their parents 
environment.  The child's environment is setup by the parent, just 
before exec is called, but the child has no corresponding facility.

Andrae

-- 
  Andrae Muys    <andrae.muys at braintree.com.au>
  Engineer       Braintree Communications
   "Now, allowing captured continuations to be inspected and altered at
    runtime (including binding mutation, complete rebinding of scopes,
    and call tree mutation)...  *that* is really evil.  And, I should
    point out, quite useful."        - Dan Sugalski



--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list