Using shell script for CGI
Posted on 1998-12-04
I want to use a shell script as a cgi that basically GREPs
a text file. I can use $QUERY_STRING in the grep statement,
but if I call this script from a form and pass it a value,
what's the easiest way of stripping the name= prefix from the value of QUERY_STRING? I only need to pass one value.
Here's the basic script:
echo Content-type: text/html
echo Searching on: $QUERY_STRING
grep $QUERY_STRING /somedir/myfile.txt
Calling the cgi as a standalone URL works, but with a FORM the name= is prepended to the query - how can I reference everything after the '=' in the GREP?