IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New %ENV not set by subprocesses.
Which is exactly the problem. :-)
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Re: %ENV not set by subprocesses.
Why don't you just parse the other script and look for the set statements (setenv, export, whatever)? Dunno perl, but in rexx, you could do something like this:
envsource = .stream~new(somescript.cmd)\nlines = envsource~makearray\ndo i = 1 to lines~lines\n   if lines[i]~word(1) = "set"\n      then do\n      parse var lines[i] . envvar '=' newval\n      value('OS2ENVIRONMENT', envvar, newval)\n      end /* End if */\n   else iterate\nend /* End do loop */\ndrop lines\nenvsource~close

Note that I haven't actually tested this, but should give you the general idea. It assumes you can read the file, of course, but if you can execute it I'm sure you can read it. Sure, it's an ugly hack, but it would work, and would permit you to let someone change the file without worrying about it breaking your program.
--\n-------------------------------------------------------------------\n* Jack Troughton                            jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca]                   [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada               [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
New That assumes the values aren't calculated.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
     Perl, system, backticks, and environment variables - (admin) - (15)
         Check out %ENV - (Yendor) - (3)
             %ENV not set by subprocesses. - (admin) - (2)
                 Re: %ENV not set by subprocesses. - (jake123) - (1)
                     That assumes the values aren't calculated. -NT - (admin)
         Perhaps I'm dense. - (Another Scott) - (1)
             This is a CGI perl script - (admin)
         Parent-child environment inheritence - (kmself)
         In the script report ENV and parse that in the caller - (ben_tilly) - (7)
             Can't do that. - (admin) - (6)
                 How about writing a wrapper for the script that sources it? - (Arkadiy) - (4)
                     It's a CGI script - (admin) - (3)
                         I guess I don't know CGI ... - (Arkadiy) - (2)
                             bash script? -NT - (ChrisR) - (1)
                                 Perl CGI calling base environment script. - (admin)
                 WAG - (boxley)

With one hand tied behind my back.
74 ms