|
|
![]() |
|
|
|
|
||
|
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
|
Editors
Contact the Editors |
|
Last Updated: 6/19/02 Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. |