By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,171 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

How to debug CGI scripts with simulated variables from server?

P: n/a
I want to debug a script that has a line like the following:
if len(os.environ["QUERY_STRING"]) > 0:

How do I debug this from the command line. I tried
QUERY_STRING='sized=72&shaped=3' ./aqua_getShapes

But that returns:
QUERY_STRING=sized=72&shaped=3: Command not found.

Please help. Thanks
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sean Berry <se********@cox.net> wrote:
I want to debug a script that has a line like the following:
if len(os.environ["QUERY_STRING"]) > 0:

How do I debug this from the command line. I tried
QUERY_STRING='sized=72&shaped=3' ./aqua_getShapes

But that returns:
QUERY_STRING=sized=72&shaped=3: Command not found.


Works fine here (Slackware-9.1 Linux, bash-2.05b). Try
export QUERY_STRING=...
./aqua_getShapes

--
William Park, Open Geometry Consulting, <op**********@yahoo.ca>
Linux solution/training/migration, Thin-client
Jul 18 '05 #2

P: n/a
At some point, "Sean Berry" <se********@cox.net> wrote:
I want to debug a script that has a line like the following:
if len(os.environ["QUERY_STRING"]) > 0:

How do I debug this from the command line. I tried
QUERY_STRING='sized=72&shaped=3' ./aqua_getShapes

But that returns:
QUERY_STRING=sized=72&shaped=3: Command not found.

Please help. Thanks


Are you using tcsh as your shell? The syntax above works with Bourne
shells (bash, etc.). With tcsh, try

$ env QUERY_STRING='sized=72&shaped=3' ./aqua_getShapes

('env' being the same program that most Python scripts use to find the
interpreter in the #! line: #! /usr/bin/env pytho)

or, set the variable in the environment

$ setenv QUERY_STRING='sized=72&shaped=3'
$ ./aqua_getShapes

--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.