Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I have a unix shell script like that: .... export username=scott export password=tiger ... I have a perl script call this shell script, and try to get the value of username password and use in perl script. Could you tell me how to do that? Thanks, Carl
Post Follow-up to this messagelinlin107 wrote:
> Hi,
>
> I have a unix shell script like that:
>
> ....
> export username=scott
> export password=tiger
> ...
>
> I have a perl script call this shell script, and try to get the value of
> username password and use in perl script.
unix% perldoc -q environment
Found in /usr/lib/perl5/5.8.3/pod/perlfaq8.pod
I {changed directory, modified my environment} in a perl script.
How
come the change disappeared when I exited the script? How do I
get my
changes to be visible?
Unix
In the strictest sense, it can't be done--the script
executes as a
different process from the shell it was started from.
Changes to a
process are not reflected in its parent--only in any
children cre-
ated after the change. There is shell magic that may allow
you to
fake it by eval()ing the script's output in your shell;
check out
the comp.unix.questions FAQ for details.
Post Follow-up to this message
"linlin107" <linlin107@rogers.com> wrote in message
news:pJWdnU9wysQXeT7cRVn-ig@rogers.com...
> Hi,
>
> I have a unix shell script like that:
>
> ....
> export username=scott
> export password=tiger
> ...
>
> I have a perl script call this shell script, and try to get the value of
> username password and use in perl script.
>
> Could you tell me how to do that?
$ENV{username}='scott';
$ENV{password}='tiger';
*However*, that leds me to think you are going to be doing Oracle SQL
queries.
Head on over to http://dbi.perl.org/
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.