Calling bash script from CGI

Tags
programming

 
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

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Calling msys shell from bash script sweetu1995 Shell Programming and Scripting 5 06-16-2015 01:22 AM
Password check in bash script calling on expect 2legit2quit Shell Programming and Scripting 1 04-21-2015 01:17 PM
Calling bash script works when called manually but not via Cron? wyclef Shell Programming and Scripting 6 03-26-2015 04:00 PM
CGI Perl script to execute bash script- unable to create folder rakeshkumar Programming 0 07-19-2012 04:10 AM
Calling function from another bash script kristinu Shell Programming and Scripting 11 04-05-2012 11:32 AM
Calling a Perl script in a Bash script -Odd Situation leepet01 Shell Programming and Scripting 5 09-15-2011 05:56 PM
Calling BASH script from JAVA lakshman.forums Red Hat 0 05-23-2011 12:24 PM
Run Program from Bash CGI-Script JMooney5115 Homework & Coursework Questions 8 01-27-2011 07:51 PM
Delete Files with CGI Bash Script JMooney5115 Shell Programming and Scripting 4 01-18-2011 03:43 PM
Quick question: calling c-shell script from bash lapiduslost Shell Programming and Scripting 1 01-11-2011 12:58 PM
Calling bash command in perl script sQew Shell Programming and Scripting 12 12-08-2010 06:15 AM
Perl cgi script to call bash script? pleonard Shell Programming and Scripting 0 06-02-2009 02:57 PM
calling a cgi file from shell script???? elavv Shell Programming and Scripting 1 08-07-2008 04:32 AM
Calling CGI Perl in Shell script [urgent] DeepakXavier Shell Programming and Scripting 0 10-09-2005 02:51 AM
Wrapping a bash script for CGI andyj Shell Programming and Scripting 2 07-16-2003 01:46 PM