Home Man
Search
Today's Posts
Register

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

Calling bash script from CGI

Tags
programming

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
Calling Bash Functions in the BG stonkers Shell Programming and Scripting 7 07-08-2016 02:37 PM
Calling msys shell from bash script sweetu1995 Shell Programming and Scripting 5 06-16-2015 12:22 AM
Password check in bash script calling on expect 2legit2quit Shell Programming and Scripting 1 04-21-2015 12:17 PM
Calling bash script works when called manually but not via Cron? wyclef Shell Programming and Scripting 6 03-26-2015 03:00 PM
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
Quick question: calling c-shell script from bash lapiduslost Shell Programming and Scripting 1 01-11-2011 11:58 AM
Calling bash command in perl script sQew Shell Programming and Scripting 12 12-08-2010 05:15 AM
cant get a counter to work in bash scipt, this is calling expect script melvin Shell Programming and Scripting 1 04-13-2010 10:15 PM


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

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