Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Suppress tracing of "set +x"
On Fri, 5 Feb 2016 11:09:02 +0100
Dominik Vogt <vogt@xxxxxxxxxxxxxxxxxx> wrote:
> set -x
> some command
> RC=$?
> { set +x; } 2>/dev/null
> test ! x$RC = x0 && exit $RC
>
> I want only "some command" traced, not "RC=$?". Yet I have to do
> it before the "set +x" because the latter overwrites $?. Any
> ideas how to get around this?
() {
setopt localoptions xtrace
some command
}
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author