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/intr anet/cgi-b in/IR2BC/l ib/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.
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/intr
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER