Hi All,
I have a shell script to find the latest version number from the head of SVN tree and this script is called from a perl routine. The script and perl routine works fine. However, the same perl script do not print anything when it is run under cgi.
Here are files.
-----------------------------------------------------------
find_latest_svn_version.sh
#!/bin/sh -v
SVNINFO="/home/buildmaster/bin/svn info"
#find the latest SVN Version
SVNVERSION=`${SVNINFO} --revision HEAD $1 | grep "Revision" | sed -e '
+s/Revision: \(.*\)/\1/'`
echo $SVNVERSION
----------------------------------------------------------
a.pl
#! /usr/bin/perl -w
print "Content-type: text/html\n\n";
print <<END_SEC1;
<html>
<head>
<title> Build DashBoard</title>
</head>
<body>
starting
</body>
</html>
END_SEC1
$findversion = "find-latest-svn-version.sh";
$srcdir = "/home/buildmaster/build/releases/sources/MPP_SW_BASE";
$scriptDir = "/home/buildmaster/build/scripts";
if( system( "$scriptDir/$findversion $srcdir") )
{
print "<br>failed<br>\n";
}
else
{
print "<br>succeeded<br>\n";
}
If I run a.pl, it prints the latest SVN Version.
However, if I copy a.pl to cgi-bin directory and run it under cgi, I do not see the svn version gettting displayed.
If I make a slight modification to find_latest_svn_version.sh removing the "--revision HEAD", I can see that it display the version number(though it is not the one from the HEAD of the tree). I could not figure out why adding this argument causes the script to behave differently. I am wondering whether there are tricks to in passing arguments correctly under cgi, as the same perl script works fine from command line.
Any help is greatly appreciated and thanks in advance.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.