#!/bin/sh -u # This CGI script displays the date and one passed argument. # ------------------------------------------------------------------ # Syntax: $0 any_string # ------------------------------------------------------------------ # Purpose: Demonstrate single argument passing in a CGI script. # Put this in your public_html/cgi-bin directory and then call up: # http://net2003.idallen.ca:8888/~abcd0001/cgi-bin/date.cgi # http://net2003.idallen.ca:8888/~abcd0001/cgi-bin/date.cgi?hello there # Since we use "-u" above, the script will generate an error if the required # argument $1 is not present. We redirect standard error to standard # output so that the error messages go to the browser, not to the system log. # ------------------------------------------------------------------ # # Comment: the required comments are missing from this sample solution # ------------------------------------------------------------------ exec 2>&1 PATH=/bin:/usr/bin ; export PATH umask 022 LC_COLLATE=C ; export LC_COLLATE echo "Content-Type: text/plain" echo "" date echo "The argument count is $#" echo "The argument is '$1'"