IBM Support

Redirecting Script output using PERL in Windows 7, Windows Server 2008

Troubleshooting


Problem

When working with earlier versions of Windows, IE: Win Srv 2003 and XP, this is not an issue. When using build forge to run a PERL scripts that outputs data to another location and or into a form. The data never arrives and is not being outputted or inputed into a form correctly. Example Command: "myperlscript.pl" This should work in earlier versions of Windows, but not in newer versions (Win 2008 and Win 7) When testing without the "perl" command, PL files (.pl) were configured to automatically run under the ActivePerl Perl Command Line Interpreter. The bfagent captures stdout and stderr from executed processes from the windows shell. When executing the script through the windows shell, perl is passing the output to the windows shell which then handles the funneling of stderr and stdout to different filehandles. That is how it works in 2003. he windows 2008 shell (powershell if it's different) seems to direct that output through non-posix-standard filehandles. posix has four perl classes it uses to handle the three standard outputs stdin stdout stederr. Well in windows 2003 and earlier versions windows funneled the stream data to standard ones, where as now it uses none standard. So while executing the script using perl as the shell, perl passes those outputs (stdout and sdterr) through the expected filehandles and it is properly captured. When running "perl foo.pl" perl handles the IO that's "normal" IO. Where as the windows 2008 shell would direct this data differently. pl2bat creates batch files that allow you to run perl scripts. This method requires you clarify perl in the command like mentioned earlier. You can now see how Micorosft has changed the way their shell works. By changing the file handlers on the shell and re-routing those. This change is Technically a way perl interacts with the data. So perl needs to capture the new streams etc. BF would then be able to utilize the functionality. So because MS changed, Perl has not and BF has not. Does this make sense? Thanks!

Symptom

Example of a Command in Build Forge: myperlscript.pl" This type of command was acceptable in earlier versions. Nothing has changed but the OS, and now it does not work as expected.

[{"Product":{"code":"SSB2MV","label":"Rational Build Forge"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Agent: Authentication","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.1.3;7.1.2;7.1","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

More support for:
Rational Build Forge

Software version:
7.1.3, 7.1.2, 7.1

Operating system(s):
Windows

Document number:
222091

Modified date:
16 June 2018

UID

swg21627959

Manage My Notification Subscriptions