Hi Bruce,

On 28 Jan 2013, at 08:32, Bruce Korb <bruce.k...@gmail.com> wrote:
> Also, I don't know how you use $debug_cmd,

It's all in the comments :)

# Allow overriding, eg assuming that you follow the convention of
# putting '$debug_cmd' at the start of all your functions, you can get
# bash to show a function call trace with:
#
#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
debug_cmd=${debug_cmd-":"}

> but for me this works very well:
> 
>  PS4='>$FUNCNAME> '
> 
> You always know which function was active for every xtrace entry.

Good tip!  Thanks :)

Once upon a time I also wrote a full interactive debugger for bash (full
disclosure: I cribbed a lot of it from the ORA ksh book, with permission),
which I think is still included in the distribution.  However, I've taken
to writing bug-free code these days, so haven't used it in a very very
long time :*)

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)

Reply via email to