Well, actually... http://www.yolinux.com/TUTORIALS/BashShellCgi.html
If you gonna go that road, then use netcat echo and loops for a web server too.
Well, actually... http://www.yolinux.com/TUTORIALS/BashShellCgi.html