File : env.cgi


The Environment is

_keyword             |                            | identifier of the type keyword
...more here...
PWD                  | /srv/www/cgi-bin           | identifier of the type universal_string
OLDPWD               |                            | identifier of the type universal_string
HOME                 |                            | identifier of the type universal_string
SHELL                | /usr/local/bin/spar        | exported identifier of the type universal_string
TERM                 | xterm                      | exported identifier of the type universal_string
AUTH_TYPE            |                            | constant string
AUTH_USER            |                            | constant string
GATEWAY_INTERFACE    | CGI/1.1                    | imported constant string
CONTENT_LENGTH       |                            | constant string
CONTENT_TYPE         |                            | constant string
PATH_INFO            |                            | constant string
PATH_TRANSLATED      |                            | constant string
REMOTE_HOST          |                            | constant string
REMOTE_IDENT         |                            | constant string
REMOTE_USER          |                            | constant string
REQUEST_METHOD       | GET                        | imported constant string
QUERY_STRING         |                            | imported constant string
SCRIPT_NAME          | /cgi-bin/env.cgi           | imported constant string
SERVER_SOFTWARE      | Apache/2.2.15 (Linux/SUSE) | imported constant string
SERVER_NAME          | localhost                  | imported constant string
SERVER_PROTOCOL      | HTTP/1.1                   | imported constant string
SERVER_PORT          | 80                         | imported constant string

#!/usr/local/bin/spar -i

-- You can include command line options in #!.  In this case, import the
-- entire environment.

pragma annotate( summary, "env.cgi" );
pragma annotate( description, "List the environment variables on the server" );
pragma annotate( author, "Ken O. Burtch" );
pragma license( unrestricted );

-- run env and get the results

env_result : string := `env;`;

-- display the results using this template

pragma template( html, "env.tmpl" );

-- VIM editor formatting instructions
-- vim: ft=spar


<!-- env.tmpl: List the environment variables on the server -->
<html>
<head>
<title>env.sp example</title>
</head>
<body>
<h1>The Environment is</h1>
<pre>
<?bush ? env_result; ?>
</pre>
</body>
</html>