What the ? ?
I was working with a rather complex script. It builds a command line to install a package of hotfixes as defined in an input file. The script reads the INI-format file and gets a list of hotfixes to apply. It then looks for each hotfix section to see if there are exceptions, different parameters, etc. before executing the hotfix file. It completes the process by running QCHAIN.exe. This has been working fine.
I decided to add some logging, since when we have our third-shift operations staff apply the hotfix package, the information scrolls by so fast they can't tell if it worked or not (they're "general" operators with Mainframe, Unix and NT skills - not NT admins.)
I'm not at work, so I'll pseudo-code - it works soft of like this:
code:
if $OPTION = "-l"
$LOG = " 2>&1>> LogFile.txt"
EndIf
some other code...
$HFIX = "123456i.exe" ; read fom file
$PARM = "-z"
$CMD = "%COMSPEC% /c $HFIX $PARM" + $LOG
? "Executing $CMD" ?
shell $CMD
At this time, when the shell command executes, it fails (unless I've passed the -l and defined the $LOG var) because the $CMD ends in "$LOG"
I fixed it by declaring $LOG="" at the beginning of the script, but I started doing the simple tests I illustrated before I posted the message. Now, at home (v4.12), it works the way you say (and the way I wanted it to!).
I'll review it again when I return to the office on Monday, but for now, I'm speechless.
Glenn
_________________________
Actually I
am a Rocket Scientist!