#!/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" ;