Tracing a Qshell Variable
June 19, 2002 Timothy Prickett Morgan
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 |