04-14-2011
execute shell script using CGI for html site
hi there
im currently in the process of creating a website for use basically within our org. im using a os x machine and installed MAMP - which includes Apache, mysql... the site will be used by techs to primarily install pkgs files onto os x devices. i would like to have buttons or hyperlinks (doesnt matter) that when the tech selects the object (e.g. a pkg file - adobe reader)... a sh script is executed that will basically install the app onto the os x device. i have placed a test shell script in the cgi-bin folder and changed ownership so its executable (chmod +x scriptname).
the test script looks like this:
#!/bin/sh
echo "content-type: text/html"
""
mkdir /users/test/thisisatestfolder
in the html page - i dont know how i would "call it" , e.g. form etc...
i dont even know if the script is set-up right as well
any help would be great
thanks!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
AAAHHH!! I've made a perl program that you can run on a web browser. This program needs to be run everyday, and I don't want to have to run it everyday. The problem is when I try running the program from my terminal, all it does is print stuff to the terminal page (the program involves a lot of... (4 Replies)
Discussion started by: sstevens
4 Replies
2. Shell Programming and Scripting
I wrote a script to automate user account verification against peoplesoft. Now I want to make it available to my peers via the web. It is running on Solaris.
I have the form written, but am not sure how to make it work. I think the form should call a perl cgi when submitted. The cgi should call... (7 Replies)
Discussion started by: 98_1LE
7 Replies
3. Shell Programming and Scripting
Hey - I am new to cgi scripting... just writing a script to output df -k output to html page... but I cannot get the df lines on separate lines on the page, it all comes out on one line and is not very readable.. any suggestions?
My script is below - please keep in mind I am only new to it so... (1 Reply)
Discussion started by: frustrated1
1 Replies
4. Shell Programming and Scripting
Hi,
I'm learning some simple cgi scripting. I can make a script like this,
so my browser shows "Hello World"
/www/cgi-bin/name.sh
---
#!/bin/sh
MyName=World
echo "<html> Hello $MyName </html>"
---
What I'd like is to have a separate html and script files in the cgi folder so ... (1 Reply)
Discussion started by: Performer
1 Replies
5. Shell Programming and Scripting
Hi,
I have an HTML form through which I get some text as input. i need to run a shell script say script.sh inside a perl-cgi script named main_cgi.sh on the form input.
I want to write the contents of the form in a file and then perform some command line operations like grep, cat on the text... (2 Replies)
Discussion started by: smriti_shridhar
2 Replies
6. Shell Programming and Scripting
I want to execute a shell script when clicking on an html link. I want the output of the script to be shown on the webpage. Whats the best way to achieve this? (6 Replies)
Discussion started by: streetfighter2
6 Replies
7. Shell Programming and Scripting
Hi
I know how to pass data from client side (html file) to server using CGI script (POST method).
I also know how to re-create the html page from server side after receiving the data (using printf).
However I want to write static pages on client side (only the structure), and only to pass... (0 Replies)
Discussion started by: naamabm
0 Replies
8. Programming
Hi
I have a bash script which takes parameters
sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC
gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash
I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I am trying to create a php file that would copy given index.html file to all directories (and subdirectories) on my site that don't have one. This is to prevent directory listings on nginx. This index.html file is placed in the /populate directory and looks like this:
<html>
<head>... (7 Replies)
Discussion started by: teletubby
7 Replies
10. UNIX for Beginners Questions & Answers
Hello,
I want to run this script on my CentOS 6 via browser :
________________________________________________________________________________________________
#!/bin/sh
echo Username?
read MY_NAME
echo Provisional file name?
read MY_FILE
echo File NAME you want to save?
read MY_FILE2... (16 Replies)
Discussion started by: juta2020
16 Replies
LEARN ABOUT DEBIAN
cgi::ssi_parser
SSI_Parser(3) User Contributed Perl Documentation SSI_Parser(3)
NAME
CGI::SSI_Parser - Implement SSI for Perl CGI
SYNOPSIS
use CGI::SSI_Parser;
$CGI::SSI_Parser::recursive = 1;
fssi($filename);
sssi($string);
DESCRIPTION
CGI::SSI_Parser is used in CGI scripts for parsing SSI directives in files or string variables, and fully implements the functionality of
apache's mod_include module.
It is an alternative to famous Apache::SSI modules, but it doesn't require mod_perl. This is an advantage to those who are using public
hosting services. There is a disadvantage, however - the module consumes much memory, and I don't recommend using it on heavy-loaded sites
(currently it's being used on a site with 10000 hits, and I consider this as a limit). I hope to get rid of this disadvantage by the time
the release comes out (currently it's beta).
SSI Directives
This module supports the same directives as mod_include. For methods listed below but not documented, please see mod_include's online docu-
mentation at http://httpd.apache.org/docs/mod/mod_include.html .
o config
o echo
This directive is not fully supported in current version.
o exec
o fsize
o flastmod
o include
o printenv
o set
This directive is not supported in current version.
o perl
This directive is not supported in current version.
o if
o elif
o else
o endif
These four directives are not supported in current version.
Outline Usage
First you need to load the CGI::SSI_Parser module:
use CGI::SSI_Parser;
You need to specify the following when processing of all nested directives is needed (default value - 0):
$CGI::SSI_Parser::recursive = 1;
To parse file or string you need to use:
fssi($filename);
sssi($string);
The result is printed to STDOUT.
TO DO
Full implementation of all SSI directives.
Optimize memory consumption.
AUTHOR
Vadim Y. Ponomarenko, vp@istc.kiev.ua
SEE ALSO
mod_include, perl(1).
perl v5.8.0 2001-01-06 SSI_Parser(3)