A comprehensive survey of incompatibilities between Bash
and the classic Bourne shell.
Same as above, but for the Korn shell (ksh).
A primer on CGI programming, using Bash.
Here's a simple CGI script to get you started.
Example P-1. Print the server environment
# May have to change the location for your site.
# (At the ISP's servers, Bash may not be in the usual place.)
# Other places: /usr/bin or /usr/local/bin
# Might even try it without any path in sha-bang.
# by Michael Zick
# Used with permission
# Disable filename globbing.
# Header tells browser what to expect.
echo Content-type: text/plain
echo CGI/1.0 test script report:
echo environment settings:
echo whereis bash?
echo who are we?
echo argc is $#. argv is "$*".
# CGI/1.0 expected environment variables.
echo SERVER_SOFTWARE = $SERVER_SOFTWARE
echo SERVER_NAME = $SERVER_NAME
echo GATEWAY_INTERFACE = $GATEWAY_INTERFACE
echo SERVER_PROTOCOL = $SERVER_PROTOCOL
echo SERVER_PORT = $SERVER_PORT
echo REQUEST_METHOD = $REQUEST_METHOD
echo HTTP_ACCEPT = "$HTTP_ACCEPT"
echo PATH_INFO = "$PATH_INFO"
echo PATH_TRANSLATED = "$PATH_TRANSLATED"
echo SCRIPT_NAME = "$SCRIPT_NAME"
echo QUERY_STRING = "$QUERY_STRING"
echo REMOTE_HOST = $REMOTE_HOST
echo REMOTE_ADDR = $REMOTE_ADDR
echo REMOTE_USER = $REMOTE_USER
echo AUTH_TYPE = $AUTH_TYPE
echo CONTENT_TYPE = $CONTENT_TYPE
echo CONTENT_LENGTH = $CONTENT_LENGTH
# Here document to give short instructions.
1) Drop this in your https://domain.name/cgi-bin directory.
2) Then, open https://domain.name/cgi-bin/test-cgi.sh.