mgo
OS/400 Edition
Volume 2, Number 47 -- June 19, 2002

Tracing a Qshell Variable


Hey, Ted:

A variable is getting changed in a Qshell script, but I can't determine where it's happening. How can I track changes to a variable?

-- Len



Add the following lines to the top of the script:

trap 'echo "DBG: \$var = \"$var\""' DEBUG
set -x 


The trap command with the DEBUG condition executes the command between single quotes (') after each simple command of the script runs. In this case, Qshell echoes the value of a variable named var to the display. Replace var with the name of your variable.

The set command with -x option causes Qshell to echo each command to stderr before running it.

This is going to clutter up the display, but you should find where the variable changes and which command changes it.

-- Ted



Sponsored By
JACADA

Research on Presentation Integration Server Market

Many changes have occurred in the presentation integration server market according to Gartner's most recent Magic Quadrant research. Jacada is positioned in the leader quadrant for the fifth year in a row. This is important research for anyone planning presentation integration server projects.

View the report courtesy/with compliments of Jacada at http://www.jacada.com/gartner/quadrant32


THIS ISSUE
SPONSORED BY:

Jacada
Tramenco


BACK ISSUES

TABLE OF CONTENTS

Tracing a Qshell Variable

LAYOUT: An Improved DSPFFD

Reader Feedback and Insights: String Parameters of Various Lengths



Editors
Howard Arner
Joe Hertvik
Ted Holt
David Morris

Managing Editor
Mari Barrett

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com



Last Updated: 6/19/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.