![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl -write values in a file to @array in perl | meghana | Shell Programming and Scripting | 27 | 06-07-2009 05:05 PM |
| ksh construct | ajcannon | Shell Programming and Scripting | 2 | 09-27-2007 09:08 AM |
| Embedding xnest in C code | lesnaubr | High Level Programming | 4 | 08-13-2007 02:27 PM |
| Problem with looping construct | mikie | Shell Programming and Scripting | 6 | 09-07-2006 08:48 AM |
| extracting info from Unix database to construct a visual diagram | fusion99 | UNIX for Advanced & Expert Users | 0 | 11-30-2004 01:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Embedding Perl construct in ksh...
Hi,
I have an embedded Perl construct in a korn script. However, I cannot seem to access the shell variables that were declared outside this Perl section. This is how my script is written....I have also tried back-ticks where I assign the shell variable to my local perl variable, still doesn't work. #!/usr/ksh shell_var1 shell_var2 .. some ksh code.. .. # perl section below... perl <<-'EOF' local $perl_variable1=${shell_var1} .. some code .. EOF .. .. Please help. Thanks in advance! Cheers, Vit |
|
||||
|
Use the %ENV hash to access environment variables. Environment variables will not normally become Perl variables (unless you write some code to do so) magically. But note that, because perl is executed as a process, you cannot change the corresponding environment variable in the shell from Perl, because what you will get from Perl is just a copy:
Code:
$ ( export TEST="me"; perl -e 'print $ENV{"TEST"}, "\n"'; )
me
$ echo $0
ksh
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|