Ronnie has asked for the wisdom of the Perl Monks concerning the following question:
OLDHOME=${ORACLE_HOME} ; export OLDHOME unset TWO_TASK; ORACLE_SID=IHSLIVE ; export ORACLE_SID ORACLE_BASE=/ihs/tpp/oracle/live ; export ORACLE_BASE ORACLE_DOC=${ORACLE_BASE}/doc ; export ORACLE_DOC ORACLE_HOME=${ORACLE_BASE}/9.2.0 ; export ORACLE_HOME ORACLE_PAGER=/usr/bin/pg ; export ORACLE_PAGER ORACLE_LPSTAT=/usr/bin/lpstat ; export ORACLE_LPSTAT ORACLE_LPPROG=/usr/bin/lp ; export ORACLE_LPPROG ORACLE_LPARGS='-o nobanner' ; export ORACLE_LPARGS #
This produces an error which I'm guessing may be caused by the format of our packages environment.The error generated is#!/usr/bin/perl -w # use strict ; # sub get_login_env { local %ENV; # my $shell = shift || (getpwuid($<))[8]; # # I know that the shell we use is the ksh # # my $shell = '/bin/ksh' ; my $env = `echo env | perl -e 'exec {"$shell"} -sh'`; if (wantarray) { my @pieces = ($env =~ m/^(.*?)=((?:[^\n\\]|\\.|\\\n)*)/gm ); s/\\(.)/$1/g foreach @pieces; return @pieces; } else { return $env; } } # # Variables #----------# my $result = undef ; # Processing #----------# print "\n\t\tPlay with ENV starts\n" ; $result = system(". /opt/bin/oraIHSLIVE.env") ; # print "\n\tRES :: $result\n" ; if ($result) { print "\n\t\tRes :: $result\n" ; print "\n\t\tBombing Out (1)\n" ; exit 122 ; } # $result = system(". /opt/bin/fsw.env IHSLIVE") ; # if ($result) { print "\n\t\tRes :: $result\n" ; print "\n\t\tBombing Out (2)\n" ; exit 123 ; } # %ENV = (%ENV, get_login_env()); print "\n\t\tPlay with ENV ends\n" ;
Ignoring the ADMIN_DIR message - well we do apparently! - does this mean that tilly's code won't work with the format of our environment? If so I suppose I better get typing....for the next X days!$ xxrc_pickup_env.pl Play with ENV starts RES :: 0 Environment variable ADMIN_DIR is not set grep: can't open a grep: can't open tty Play with ENV ends
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parent Process Environment
by bart (Canon) on May 02, 2006 at 09:56 UTC | |
|
Re: Parent Process Environment
by Tanktalus (Canon) on May 02, 2006 at 15:03 UTC |