Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.shell > #4883

Re: [zsh] How to mimic errexit within subshell (or function)?

From kj <no.email@please.post>
Newsgroups comp.unix.shell
Subject Re: [zsh] How to mimic errexit within subshell (or function)?
Date 2012-05-02 19:33 +0000
Organization none
Message-ID <jns26e$h77$1@reader1.panix.com> (permalink)
References <jnpk36$jqs$1@reader1.panix.com> <20120502063438.GA10446@chaz.gmail.com>

Show all headers | View raw


In <20120502063438.GA10446@chaz.gmail.com> Stephane Chazelas <stephane.chazelas@gmail.com> writes:

>Try 

>zsh -ec '
>  cmd1
>  cmd2...
>' || ...

>Or:

>(
>  setopt nodebugbeforecmd
>  TRAPDEBUG() { ((!$?)) || exit; }
>  cmd1
>  cmd2...
>) || ...


Thanks!

>I personally wouldn't touch "set -e" with a barge pole,


*gulp*, that's really bad news, since I have 'set -e' all over my
scripts...

I just searched for "set -e" bugs for zsh online, and found only
a couple of (sufficiently distinct-looking) hits:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520101
  http://permalink.gmane.org/gmane.linux.debian.devel.bugs.general/545456

Is this what you have in mind?

~k

Back to comp.unix.shell | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[zsh] How to mimic errexit within subshell (or function)? kj <no.email@please.post> - 2012-05-01 21:20 +0000
  Re: [zsh] How to mimic errexit within subshell (or function)? Stephane Chazelas <stephane.chazelas@gmail.com> - 2012-05-02 07:34 +0100
    Re: [zsh] How to mimic errexit within subshell (or function)? Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2012-05-02 13:51 +0100
      Re: [zsh] How to mimic errexit within subshell (or function)? Stephane Chazelas <stephane.chazelas@gmail.com> - 2012-05-02 14:29 +0100
    Re: [zsh] How to mimic errexit within subshell (or function)? kj <no.email@please.post> - 2012-05-02 19:33 +0000
      Re: [zsh] How to mimic errexit within subshell (or function)? Stephane Chazelas <stephane.chazelas@gmail.com> - 2012-05-02 20:53 +0100
  Re: [zsh] How to mimic errexit within subshell (or function)? Martin Vaeth <vaeth@mathematik.uni-wuerzburg.de> - 2012-05-02 10:30 +0000
    Re: [zsh] How to mimic errexit within subshell (or function)? kj <no.email@please.post> - 2012-05-02 19:09 +0000
      Re: [zsh] How to mimic errexit within subshell (or function)? kj <no.email@please.post> - 2012-05-02 19:12 +0000
      Re: [zsh] How to mimic errexit within subshell (or function)? Stephane Chazelas <stephane.chazelas@gmail.com> - 2012-05-02 20:27 +0100
        Re: [zsh] How to mimic errexit within subshell (or function)? kj <no.email@please.post> - 2012-05-03 18:20 +0000

csiph-web