Unix command output displayed 0 in browser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahulja
    New Member
    • Jul 2007
    • 2

    Unix command output displayed 0 in browser

    Hi EveryBody,
    I am beginner in perl. I am trying for following program for displaying no. of license on apache. But it is giving 0 output in browser. But in command line it comes number (e.g. 25).
    Can anybody please tell me why happening this?
    Thanx in advance.

    ###### process.pl##### #
    #!/usr/bin/perl -w
    use CGI qw(:standard);
    print "content-type: text/html \n\n";
    my $lic1 = "";
    $lic1 = `lmstat -a -c 8064\@servernam e -feature Abaqus|grep "start" |wc -l`;
    $ENV{'myvar'} = "$lic1";
    print `perl end.pl`;
    exit;

    #####ouput.pl## ####
    #!/usr/bin/perl -w
    use CGI qw(:standard);
    if($ENV{'myvar' }) {print "success!<b r />" . $ENV{'myvar'};}
    else {print "failure :(";}
    exit;
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Your cgi script must not be able to run the lmstat command:

    $lic1 = `lmstat -a -c 8064\@servernam e -feature Abaqus|grep "start" |wc -l`;

    Comment

    Working...