January 2004
Intermediate to advanced
368 pages
7h 25m
English
Sometimes scripts can be quite simple and still have useful results. For example, while I was developing some of the scripts for this chapter, Apple released its Safari web browser. My immediate question was, "How does Safari identify itself within the HTTP_USER_AGENT string?"
Finding the answer is quite a simple task for a CGI script, a script that can be written in the shell.
#!/bin/sh # showCGIenv - Displays the CGI runtime environment, as given to any # CGI script on this system. echo "Content-type: text/html" echo "" # Now the real information echo "<html><body bgcolor=\"white\"><h2>CGI Runtime Environment</h2>" echo "<pre>" env || printenv echo "</pre>" echo "<h3>Input stream is:</h3>" echo ...
Read now
Unlock full access