Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

shell_scripts_from_web_pages

1

from address bar in web browser

http://141.97.54.237/cgi-bin/testsh0.sh?seamus+peter+everyone+22

#!/bin/sh
#script testsh0.sh
echo Content-type: text/plain
echo
echo hello
echo argc is $#. argv is "$*".
echo
echo this is a test
echo $1
echo $0

OUTPUT AS FOLLOWS :

hello argc is 4. argv is seamus peter everyone 22. this is a test seamus /usr/local/apache/cgi-bin/testsh0.sh

 

2- ref - http://www.fpx.de/fp/Software/ProcC GIsh.html

The Form

<form action="http://our-server/cgi-stuff/mailer" method="post">

<dl>

  <dt> Your Email <dd> <input name="email" size="50">

  <dt> Filename   <dd> <input name="file"  size="50">

</dl>

<input type="submit" value="Submit">

</form>

The Script

#!/bin/sh

eval `proccgi.sh $*`

mail $FORM_email < $FORM_file

cat - << \END

echo Content-type: text/plain

echo

echo done.

END

As you can see, after the call to proccgi.sh, the email address from the form is stored in the shell variable $FORM_email, and the file name is in $FORM_file.