473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to debug CGI scripts with simulated variables from server?

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
2 1994
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Matthew Louden | last post by:
I want to know what's the best way to debug ASP pages? Now, I just put the following code when I got run-time error, but sounds like not efficient. Please advice! Thanks! Response.Write "Here"...
4
by: Rigs | last post by:
Hi, Does anyone happen to have a debug script that will display the variable name and value for all of the local variables on an .asp page? (not session nor application, as I already have...
3
by: Stephanie | last post by:
I have a problem that I am trying to solve. We have a huge product with a whole lot of ASP and VB code. VB code is all ActiveX dlls which are used by ASP app. When I attempt to add features or fix...
4
by: Stephen Miller | last post by:
Hi, I am running v1.1.4322 on Win2K server and unable to debug a ASP.Net application running locally, using a full URL (ie www.mysite.com). When I hit F5, I get the following error message: ...
10
by: Scott | last post by:
I have a simple asp.net app which works fine in debug mode, but crashes on the following line when I run it on the production server: Dim dt As DataTable I have tried the following variations...
2
by: NAGY | last post by:
hello, I created an asp.net web app in C# from a non administrative account in Visual Studio 2003, .net 1.1. when i try to run the application in debug mode from Debug start menu option, i get an...
46
by: Ian Boyd | last post by:
IIS5, on a Windows 2000 Server machine. Debeg.WriteLine "Hello, world!" How can i view it?
2
by: Bill_DBA | last post by:
I have the following stored procedure that is called from the source of a transformation in a DTS package. The first parameter turns on PRINT debug messages. The second, when equals 1, turns on the...
2
by: darrel | last post by:
Quick background: Our department reveived new PCs a few weeks ago. Alas, due to new security policies, we weren't immediately set up as admins of our own machines, so most of us developers had...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.