Most likely, either the command is not in the path for CGI scripts (try setting $ENV{PATH} or calling the command with the full pathname), or the web server, which should run as 'nobody', doesn't have permission to run the command properly.
10:29am, TapasranjanMohapatra wrote:
All, i am new to cgi. Please let me know why I dont get the data printed? I have abc.cgi in /var/www/cgi-bin
When the $cmd is "ls" I get the filenames when I visit localhost/cgi-bin/abc.cgi But when the $cmd is the snmpquerry, I get nothing on the page, though I get the desired output(value of sysContact.0) when I run the script in commandline.
---------------------------- #! /usr/bin/perl print "Content-type: text/html\n\n"; print <<"END OF PRINT"; <html> <head><title>test</title></head> <body> END OF PRINT my $cmd = "snmpget 23.23.23.23 public sysContact.0"; #my $cmd = "ls"; my $res = qx!$cmd!; chomp($res); print <<"end of print"; <center> $res </center> </body></html> end of print -------------------------------------
TIA Tapas
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
------------------------------------------------------------- Note the obsessive use of abbreviations and avoidance of capital letters; this is a system invented by people to whom repetitive stress disorder is what black lung is to miners. Long names get worn down to three-letter nubbins, like stones smoothed by a river. ---Neal Stephenson, on Unix filesystem naming conventions----
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>