call shell script from perl cgi script problem | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

call shell script from perl cgi script problem

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-23-2009
raksha.s raksha.s is offline
Registered User
 
Join Date: Feb 2009
Last Activity: 4 September 2009, 11:15 PM EDT
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
call shell script from perl cgi script problem

hi,,
i have perl scipt with line :

Code:
system('./try.sh $t $d $m');

in shell scipt try.sh i have the line:

Code:
echo $1

its not printing value of $t that i hav passed..y is it so..i am running it from apache web server

Last edited by Yogesh Sawant; 03-25-2009 at 04:54 AM.. Reason: added code tags
Sponsored Links
    #2  
Old 03-23-2009
KevinADC KevinADC is offline Forum Advisor  
Registered User
 
Join Date: Jan 2008
Last Activity: 11 September 2009, 3:44 PM EDT
Posts: 729
Thanks: 0
Thanked 0 Times in 0 Posts
the first problem is that you are using single-quotes in the system function, which is killing any variable interpolation, change to double-quotes and try again:


Code:
system("./try.sh $t $d $m");

although it still may not work, the cgi script may not have permission to run the file or the path to try.sh may not be correct since you are using a relative path, relative to the perl script I think.

Last edited by Yogesh Sawant; 03-25-2009 at 04:55 AM.. Reason: added code tags
Sponsored Links
    #3  
Old 03-25-2009
raksha.s raksha.s is offline
Registered User
 
Join Date: Feb 2009
Last Activity: 4 September 2009, 11:15 PM EDT
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
thanku.it is working now
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Call a perl script inside a shell script chriss_58 Shell Programming and Scripting 3 12-01-2008 03:28 AM
here document to automate perl script that call script hogger84 Shell Programming and Scripting 3 10-22-2007 10:15 AM
How to call a perl script from a shell script anumkoshy Shell Programming and Scripting 2 08-30-2007 04:23 AM
Wget call in a Perl script rahulrathod UNIX for Advanced & Expert Users 1 12-28-2005 05:45 AM
how can call perl script as command? umen UNIX for Dummies Questions & Answers 1 10-14-2005 09:43 PM



All times are GMT -4. The time now is 09:29 PM.