#! /bin/ksh
#
# #### The world's simplest CGI-bin script
#
###
### The output of the script can be html or plain text. You will
### probably want to generate html, content-type text/html, but
### to keep things simple here I will generate plain text,
### content type text/plain. The first line of the output must be
### the content-type label, which tells the web browser what to do
### with the rest. The second line must be empty; it separates "meta"
### information describing the generated document from the generated
### document itself.
#
echo "Content-type: text/plain"
echo ""
#
###
### The web server sets up the environment before it executes the
### script. Anything useful there? We'll print the environment to
### have a look.
#
echo " === The execution environment === "
env
#
###
### Since we used the "post" action in the web page, the form data
### is available as standard input. We'll just send it copy it to
### the output.
#
echo ""
echo "========================================="
echo " === The forms data on standard input ==="
echo "========================================="
cat
#
echo ""
#
echo " === End of world's most trivial CGI script ==="
exit 0