cc: [email protected]
Subject: Re: Re: [ast-users] [ksh93] Global `set -x' ?  - tracing functions
--------

> Janis Papanagnou:
> > Something like typeset would be an advantage, as you say, if one
> > could activate it from the environment, as the OP tried to achieve.
> 
> I think it is easy to solve.
> 
> > Even worse, typeset -ft seems to work only on functions already
> > defined, so that you cannot just add it at conveniently at the top
> > of the script, rather you have to put that code after the function
> > definition and before you use the function; so most inconvenient
> > (without further hacks).
> 
> It's awkward, but I think the gist that I put up solves that.  You don't 
> even have to put the typeset -tf in your own code.
> 
> There is a simple hack:
> 
>     function f1 { : ; } && typeset -tf f1
> 
> The typeset -tf will persist when f1 is redefined.
> Current typeset behaviour (and tracef) will catch typos.
> 
> Cheers,
> Henk
> 

Even simpler, is to add the line
        .sh.fun.set() { set -x;}
to your script.

The .sh.fun.set function gets invoked whenever the shell sets the name
for the current function.


David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to