On Fri, Feb 3, 2012 at 08:31, David Korn <[email protected]> wrote:

> cc: [email protected]
> Subject: Re: [ast-users] [ksh93] Global `set -x' ?
> --------
>
> > th bash, `set -x' is global so users can debug a script by `bash -x
> > foo.sh' and every function will be traced. But with ksh, `set -x' does
> not
> > affect functions defined in the `function NAME' syntax which I think is
> not
> > convenient. Seems like ksh treats `set -x' the same way as a trap.
> >
> >
>
> With bash, what if I don't want to see the trace for functions that
> I already know work ok.  How can I disable the tracing of specific
> functions.
>
> With ksh93, you can enable the tracing of individual functions with
>        typeset -ft name ...
> or all functions with
>        .sh.fun.set() { set -x;}
>

I tried but it did not work fine. Or I used in wrong way?

$ cat set-x.ksh
.sh.fun.set() { set -x; }

function f1 { echo f1; }
function f2 { echo f2; }

f1
f2
$ ksh set-x.ksh
+ echo f1
f1
f2
$ ksh -x set-x.ksh
+ f1
+ echo f1
f1
+ f2
f2
$

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

Reply via email to