l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
October 7: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2001 Dec 30 17:07

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Calling a shell pgm from perl to change ENV
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Calling a shell pgm from perl to change ENV



On Wed, Jul 11, 2001 at 09:20:47PM -0500, Jay Strauss wrote:
> Is this only a perl thing?
> 
> Cause I can have 2 shell programs and from the 1st shell program, I can
> "source" the 2nd and change the parent's shell.
> 
> Jay

This is an 'everything' thing, including bash.  This answers my
question as to why you thought you were able to change the parent's
environment from the script (which is quite impossible).  When you
'source' a script, you are not running a seperate process; it's more
like C's #include directive.  You are actually including the source
code of the other script as part of the currently running process;
it's not changing the parent's environment, it's just changing its
own.

And naturally, source inclusions are only possible within the same
scripting envrionment (bash), so you cannot achieve the same affect
within Perl.  You'll have to approach it in a different way. :(

Micah


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.