I have a perl script that prints up the html code and executes a few korn scripts to populate the web code.
Disclaimer === I can throw together some korn scripts pretty quick. This code changes pretty frequently. I don't know enough about perl to do everything I need. One day maybe I'll get there but for now -- This does work at least on the web side.
Basically I call a korn script in a variable with tics and print the var inside the html code....
See Below:
Perl Code:
$KSH_CHECK_SCRIPT="scripts/scriptname"; #Check script for UISSssh
foreach (<IN>) {
$HOST="$_";
$KSH_CHECK=`$KSH_CHECK_SCRIPT $HOST`;
print "<tr align=left><th width=20%>$HOST</th><th width=20%>yes</th><th width=20%>yes</th><th width=20%>$KSH_CHECK</th><th width=20%>yes</th></tr>";
}
close IN;
Keep in mind this does work and gives me my expected results. Pretty ? Prob not.
After churning the ksh script, it simply echos y or n
I would like to also echo some output to a file. The script does exactly that and works as designed when I execute either the ksh script by itself or from executing perl script from the command line.
My Problem.....
However when I call the perl script form the browser it will not output the additional info from the ksh script to the text file....
In the example below, it is line 32 the is not being executed when running the perl script from the browser.
1 #!/bin/ksh
SNIP out a bunch os variables
16 VER=$( sed -n "/$PKG/"'s/.*'"$PKG"'(\([^)]*\)).*/\1/p' $COLLECT ) ## Thanks JP!
17
18 if [[ $VER = $CORRECT_VER ]];then
19 if [[ $STATUS = N ]];then
20 continue
21 else
22 STATUS=Y
23 fi
24 else
25 STATUS=N
26 MESSAGE="$MESSAGE Update Needed for ${PKG}:$VER to $CORRECT_VER"
27 fi
28
29 if [[ $STATUS = Y ]];then
30 echo "$STATUS"
31 else
32 print $MESSAGE >> $OUTPUT
33 echo "$STATUS"
34 fi
Again all the will work if I run the perl script form the command line.
Any Ideas?
-Chris