Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Perl call unix shell script
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



Report this thread to moderator Post Follow-up to this message
Old Post
linlin107
11-24-04 08:56 AM


Re: Perl call unix shell script
linlin107 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.

Report this thread to moderator Post Follow-up to this message
Old Post
Joe Smith
11-25-04 01:56 AM


Re: Perl call unix shell script
"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/



Report this thread to moderator Post Follow-up to this message
Old Post
Tintin
11-25-04 01:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:38 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.