Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Suppress tracing of "set +x"



On Wed, Dec 30, 2015 at 04:30:32PM +0100, Martijn Dekker wrote:
> Dominik Vogt schreef op 30-12-15 om 11:45:
> > "set -x" is very handy when printing commands from buils scripts
> > and such, but what really annoys me is that the final "set +x"
> > that ends tracing is also printed.  Is there really no way to
> > suppress tracing of this specific command?
> 
> { set +x; } 2>/dev/null

I've been using this for a while, and it works nicely.  But now
consiter this:

  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?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany



Messages sorted by: Reverse Date, Date, Thread, Author