Re: Environment variable evaluation in a conditional

2007-09-23 Thread kens
On Sep 21, 3:48 pm, [EMAIL PROTECTED] wrote: > On Sep 20, 9:29 am, [EMAIL PROTECTED] wrote: > > > > > On Sep 20, 2:54 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > > > [EMAIL PROTECTED] wrote: > > > > > I am currently trying to write a Perl program in a Solaris 9 > > > > environment > > > > I am try

Re: Environment variable evaluation in a conditional

2007-09-22 Thread Tom Phoenix
On 9/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > $dir_to_check = `echo $dir_to_check`; > > if (-e $dir_to_check) now finds the appropriate directory. Does it really? When $dir_to_check ends with a newline? Surely you jest. But just for fun my $dir_to_check = 'fred; rm /your/favo

Re: Environment variable evaluation in a conditional

2007-09-22 Thread smdspamcatcher
On Sep 20, 9:29 am, [EMAIL PROTECTED] wrote: > On Sep 20, 2:54 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > > > > > > [EMAIL PROTECTED] wrote: > > > > I am currently trying to write a Perl program in a Solaris 9 > > > environment > > > I am trying to process a list of variables with UNIX environmen

Re: Environment variable evaluation in a conditional

2007-09-21 Thread Rob Dixon
[EMAIL PROTECTED] wrote: On Sep 20, 2:54 am, [EMAIL PROTECTED] (Rob Dixon) wrote: [EMAIL PROTECTED] wrote: I am currently trying to write a Perl program in a Solaris 9 environment I am trying to process a list of variables with UNIX environment variables embedded in them of the form $dir_to_

Re: Environment variable evaluation in a conditional

2007-09-21 Thread smdspamcatcher
On Sep 20, 2:54 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > [EMAIL PROTECTED] wrote: > > > I am currently trying to write a Perl program in a Solaris 9 > > environment > > I am trying to process a list of variables with UNIX environment > > variables embedded in them of the form > > $dir_to_check =

Re: Environment variable evaluation in a conditional

2007-09-20 Thread useperl-jeff
--- Rob Dixon <[EMAIL PROTECTED]> wrote: > > > > It's `-d dir` for directory exist test. > > `-e` is for file exist test. > > Not really. It's > > -e for item exists > -d for item exists and is a directory > -f for item exists and is a plain file > Sorry,my mistake.You're right.

Re: Environment variable evaluation in a conditional

2007-09-20 Thread Rob Dixon
[EMAIL PROTECTED] wrote: --- [EMAIL PROTECTED] wrote: I am currently trying to write a Perl program in a Solaris 9 environment I am trying to process a list of variables with UNIX environment variables embedded in them of the form $dir_to_check = "$ENV_VAR1/some_dir/$ENV_VAR2/another_dir"; and

Re: Environment variable evaluation in a conditional

2007-09-20 Thread Rob Dixon
[EMAIL PROTECTED] wrote: I am currently trying to write a Perl program in a Solaris 9 environment I am trying to process a list of variables with UNIX environment variables embedded in them of the form $dir_to_check = "$ENV_VAR1/some_dir/$ENV_VAR2/another_dir"; and I am trying to find if another

Re: Environment variable evaluation in a conditional

2007-09-20 Thread useperl-jeff
--- [EMAIL PROTECTED] wrote: > I am currently trying to write a Perl program in a Solaris 9 > environment > I am trying to process a list of variables with UNIX environment > variables embedded in them of the form > $dir_to_check = "$ENV_VAR1/some_dir/$ENV_VAR2/another_dir"; > and I am trying to

Re: Environment variable

2007-04-23 Thread Klaus Jantzen
Jeff Pang wrote: My question: How do I set the variable in the bash script? So far I use VAR="dir1 ... dirn" export $VAR but then the content of the variable is interpreted as a single string and not a a list of strings as required by lib. Is it possible to define in bash a list of strings?

Re: Environment variable

2007-04-23 Thread Jeff Pang
My question: How do I set the variable in the bash script? So far I use VAR="dir1 ... dirn" export $VAR but then the content of the variable is interpreted as a single string and not a a list of strings as required by lib. Is it possible to define in bash a list of strings? Hello, Do it like t

Re: Environment variable

2007-04-23 Thread yaron
How about use lib split("\s+",$ENV{PATH}); Yaron Kahanovitch - Original Message - From: "Klaus Jantzen" <[EMAIL PROTECTED]> To: "Beginner Perl" Sent: 10:35:39 (GMT+0200) Asia/Jerusalem יום שני 23 אפריל 2007 Subject: Environment variable I learned that in order to pass several directorie

RE: environment-Variable from korn-schell to perl

2001-06-26 Thread Stephen Nelson
You can execute the korn-shell script internally by using system(). ## The perl script use strict; $ENV{'PASSED_FROM_PERL'} = 'Hello, ksh!'; system('ksh', 'kornscript.sh') == 0 or die "system returned ", $? << 8, "from ksh kornscript.sh; stopped"; - ## kornscript.sh echo "Passed from Perl

RE: environment-Variable from korn-schell to perl

2001-06-25 Thread Yacketta, Ronald
you have in the file, that is if they are key=value Ron > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 25, 2001 9:22 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: RE: envi

RE: environment-Variable from korn-schell to perl

2001-06-25 Thread Peter . Schopen
> >I have to source a KORN-Shell Script, so that the environment-Variables > >created by > >KORN-Shell is available in my PERL-Script. Ho do I that > > > The hash %ENV stores the environment variables. > > if ( $ENV{HOME} =~ /dave/ ) > { > print "Good morning Dave."; > } > > http:

Re: environment-Variable from korn-schell to perl

2001-06-25 Thread Paul Johnson
On Mon, Jun 25, 2001 at 08:42:11AM -0400, Craig Moynes/Markham/IBM wrote: > >I have to source a KORN-Shell Script, so that the environment-Variables > >created by > >KORN-Shell is available in my PERL-Script. Ho do I that > > The hash %ENV stores the environment variables. > > if ( $ENV{HOM

Re: environment-Variable from korn-schell to perl

2001-06-25 Thread Craig Moynes/Markham/IBM
>I have to source a KORN-Shell Script, so that the environment-Variables >created by >KORN-Shell is available in my PERL-Script. Ho do I that The hash %ENV stores the environment variables. if ( $ENV{HOME} =~ /dave/ ) { print "Good morning Dave."; } http://www.perldoc.com/perl5.6/pod

Re: Environment variable question

2001-05-08 Thread Matt Cauthorn
If you're using Unix (I think even a dos shell can do this sort of thing too), why couldn't you just do a system call to the shell? i.e. system(" export MY_Variable=whatever "); I haven't tried this, but it sure seems like it would work -- provided you're running and exiting the script as the sa

Re: Environment variable question

2001-05-04 Thread Me
> I am trying to get [one program to pass some > info to another] There's many ways to skin that cat! (Apologies to my four cats). I suggest creating a file which contains the directory name.

Re: Environment variable question

2001-05-04 Thread Hitesh Ray
Hi, I am atuomating our testing infrastructure using "Testify". The scenario is: Testify calls a script that builds and creates the necessary dir. structure useful to testify. During that process it is suppose to change the directory name. I am trying to get the perl script return the new directo

Re: Environment variable question

2001-05-04 Thread Paul
--- Hitesh Ray <[EMAIL PROTECTED]> wrote: > I am required to modify an Environment variable from one value to > another using perl script. I can access the env. variables in the perl > script using ENV. How can i modify so that when I exit my perl script > -- the env. variable has new value. Tha

Re: Environment variable question

2001-05-04 Thread Michael Lamertz
Hitesh Ray ([EMAIL PROTECTED]) wrote: > > > > Hi All, > > I am required to modify an Environment variable from one value to another > using perl script. I can access the env. variables in the perl > script using ENV. How can i modify so that when I exit my perl script -- the > env. variable has

Re: Environment variable question

2001-05-04 Thread Timothy Kimball
: I am required to modify an Environment variable from one value to another : using perl script. I can access the env. variables in the perl : script using ENV. How can i modify so that when I exit my perl script -- the : env. variable has new value. You can't. Perl scripts are child processes o