👤
Home Man
Search
Today's Posts
Register

Post questions about C, C++, Java, SQL, and other programming languages here.

Calling bash script from CGI

👤 Login to reply

 
Thread Tools Search this Thread
# 1  
Old 11-21-2017
Calling bash script from CGI

Hi,

I am having two individual scripts

Script 1): CGI script - is a simple script which trigger bash script
Script 2): Bash script - is a script which execute which collects file system utilization information from all the Unix servers

If I am executing CGI script manually from command line it is working fine but executing it through browser it is not working(CGI script is not able to call bash script)

How can i configure to run a bash script inside a CGI script?

Thanks
N
# 2  
Old 11-21-2017
Without seeing the code for either of them, I can't really do anything but guess.

If you want my guess, make sure PATH has a sane value before you call the BASH script.
# 3  
Old 11-21-2017
I would assume that it is something about an incorrect path. What does it say in the webserver logs, e.g. /var/log/httpd/access.log or .../error.log

Can you write the CGI to return information about what it is trying to do to the screen? If it's Perl CGI, something like printf "Here I am\n" ; should give you a message. You can then experiment with what it shows you so you can see what you are really trying to call, and if it exists. Remember that your CGI script will be running as the webserver, not yourself.


As another thought, how will you stop someone just connecting and running this over & over again, clogging up your server?




Robin
👤 Login to reply

« Previous Thread | Next 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
CGI Perl script to execute bash script- unable to create folder rakeshkumar Programming 0 07-19-2012 03:10 AM
Calling function from another bash script kristinu Shell Programming and Scripting 11 04-05-2012 10:32 AM
Calling a Perl script in a Bash script -Odd Situation leepet01 Shell Programming and Scripting 5 09-15-2011 04:56 PM
Calling BASH script from JAVA lakshman.forums Red Hat 0 05-23-2011 11:24 AM
Run Program from Bash CGI-Script JMooney5115 Homework & Coursework Questions 8 01-27-2011 06:51 PM
Delete Files with CGI Bash Script JMooney5115 Shell Programming and Scripting 4 01-18-2011 02:43 PM
Perl cgi script to call bash script? pleonard Shell Programming and Scripting 0 06-02-2009 01:57 PM
calling a cgi file from shell script???? elavv Shell Programming and Scripting 1 08-07-2008 03:32 AM
Calling CGI Perl in Shell script [urgent] DeepakXavier Shell Programming and Scripting 0 10-09-2005 01:51 AM
Wrapping a bash script for CGI andyj Shell Programming and Scripting 2 07-16-2003 12:46 PM


All times are GMT -4. The time now is 02:51 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password