Main Content

Shell Script for CGI on the web

Archive - Originally posted on "The Horse's Mouth" - 2004-09-26 07:45:11 - Graham Ellis

In the course of duty (providing simple "how-to" examples), I've come up with a short shell script in the Bourne again shell that allows a rudimentary lookup in a data file on a server running CGI. Nothing special about this, except it's a short example.

Run it from this link and try putting in data such as "Ca" and "DD" and "don". The source is also posted on our web site ... Enjoy!

Security note - you need to take extreme care with shell scripts that read from user form entrys and pass the values entered into commands like grep. I strongly recommend that you filter all inputs as I have done in the example using sed