Visit Jeremy's Blog.
Go Back > Blogs
User Name


OK I don't really have a good title yet but I figure I can post works in progress and other tips I've come across or other interesting things.

having fun with bash varaibles: indirect variable references

Posted 11-28-2009 at 02:38 PM by lumak (Lumak's Guide to Random Things)
Updated 11-28-2009 at 03:59 PM by lumak

Well I recently started messing around with bash scripts as cgi scripts and was wondering how to pass variables in and what not.

Well it turns out, Apache will define the variable $QUERY_STRING which will contain everything after the first question mark. You can then pars this string to define variables. The general format is "name1=val1&name2=val2". It turns out you can actually declare variables in bash using 'declare' and parameter expansion.

Attached Files
File Type: txt cgi_vars.txt (2.4 KB, 529 views)
Views 8251 Comments 2 lumak is offline


All times are GMT -5. The time now is 10:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration