[ Thanks to linuxaria for this link.
]
“Sometimes it can be useful with a simple CGI to show
the contents of a directory, or run a command with some parameters.“If you are a programmer you probably will think at a elegant
and practical solutions in Java, Ruby or PHP, but for a system
administrator may be convenient to make a simple bash program, a
language he’s using everyday.“Let’s see how to use the bash we use usually on the terminal in
a CGI program.“All these examples must be put in a file with execution
permission (by the webserver) and put on your CGI directory, in
Apache this is the directory indicate with the directive
ScriptAlias.”