| | |
how to read unix profile variable into Perl
![]() |
•
•
Join Date: Jan 2007
Posts: 6
Reputation:
Solved Threads: 0
Hello I was wondering if there is a way to read a unix profile'd variable while inside my PERL code?
I'm trying to do something like this.
[code]
system( " execute some code >> $UNIXVAR\log");
also tried
system( " execute some code >> '$UNIXVAR\log'");
[\code]
I think though that the way I'm executing my application that I'm losing my profile's exported varibles.
I'm executing my app like this
./perlapp.pl
This is on an AIX Unix environment if this helps anyone.
I'm trying to do something like this.
[code]
system( " execute some code >> $UNIXVAR\log");
also tried
system( " execute some code >> '$UNIXVAR\log'");
[\code]
I think though that the way I'm executing my application that I'm losing my profile's exported varibles.
I'm executing my app like this
./perlapp.pl
This is on an AIX Unix environment if this helps anyone.
Perl Syntax (Toggle Plain Text)
$ENV{UNIXVAR}
Last edited by masijade; Feb 26th, 2007 at 10:22 am. Reason: formatting
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Jan 2007
Posts: 6
Reputation:
Solved Threads: 0
Thanks for the quick reply, but that's not quite what I need.
I wasn't quite clear enough.
So for example say I export a path to a variable name then my perl script I want to access that path that is stored in the variable is there a way to access that?
From what I see from the $ENV variable options it holds a lot of information the system and unix environment but I do not see any profile/user variables in the list.
I wasn't quite clear enough.
So for example say I export a path to a variable name then my perl script I want to access that path that is stored in the variable is there a way to access that?
From what I see from the $ENV variable options it holds a lot of information the system and unix environment but I do not see any profile/user variables in the list.
Perl Syntax (Toggle Plain Text)
$ENV{PATH}
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Similar Threads
- $foo == $bar ? (Geeks' Lounge)
- Perl MIME handler -> how to get the invoking filehandle? (Perl)
- i use perl (Perl)
- Your thoughts regarding Perl (Perl)
- Linux/UNIX (*nix Software)
Other Threads in the Perl Forum
- Previous Thread: wanted to read a unix PATH variable into perl script
- Next Thread: Perl Script
| Thread Tools | Search this Thread |






