Handling POST data in bash cgi scripts

Handling incoming POST data in a bash script is no-brainer.   Just keep in mind all the same rules about dumping the contents of a variable differs depending on which (or lack there of) quotes you use.

—-[snip]——————————————————————————

#!/bin/bash

echo “Status: 200 OK”
echo “”

POST_DATA=$(</dev/stdin)

echo “${POST_DATA}”
—-[snip]——————————————————————————-

this is beyond easy

~ by mindrape on February 21, 2008.

Leave a Reply

You must be logged in to post a comment.