Link to home
Start Free TrialLog in
Avatar of nmretd
nmretd

asked on

Problem in calling shell script from "CGI" Perl script

Problem in calling shell script from "CGI" Perl script :

1. We have a shell script which only does SCP (secure copy) of some files from one server to other. The shell script runs fine when run on its own.
2.It even runs fine when run through a normal perl file using "SYSTEM" command.
3.But the same shell script  does not get executed when running through a CGI perl script.
4. We are running the script in the following way :
          my $script = "/export/home/selva_v/intranet/cgi-bin/IR2BC/lib/BO/1.sh";
          my $status  = -1;
          $status = system($script);
     
               if( $status != 0 )
          {
               $log->debug("Execution NOT Completed.");
          }
          else
          {
               $log->debug("Execution Completed.");
          }
5. It gives as Execution NOT Completed.   Note that the script runs fine on its own . So no errors in the shell script.
6.Even if we use a dummy shell script which just opens a file, then it gives Execution Completed. That means a file should be created, but the file is           not getting created.

Kindly do respond if anyone is able to fix it up.
SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of FishMonger
FishMonger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nmretd
nmretd

ASKER

The probblem is solved. It was a permission problem only. the login in which the web server was running didnt have the req. permissions. thanks for all your comments.