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

About these ads

~ by mindrape on February 21, 2008.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: