From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14160 invoked by alias); 9 Dec 2014 21:12:15 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19515 Received: (qmail 13315 invoked from network); 9 Dec 2014 21:12:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.25.230] X-Spam: 0 X-Authority: v=2.1 cv=RdIeCjdv c=1 sm=1 tr=0 a=c0CwWhpM9oUd/BnC3z6Gzg==:117 a=c0CwWhpM9oUd/BnC3z6Gzg==:17 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=5TVj5q_1rilgSTConlUA:9 a=CjuIK1q_8ugA:10 Date: Tue, 9 Dec 2014 21:12:09 +0000 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: Parallel backupping embedded systems...how? Message-ID: <20141209211209.330c6765@pws-pc.ntlworld.com> In-Reply-To: <20141209203114.470e80ff@pws-pc.ntlworld.com> References: <20141209182415.GB4483@solfire> <20141209203114.470e80ff@pws-pc.ntlworld.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 9 Dec 2014 20:31:14 +0000 Peter Stephenson wrote: > zmodload zsh/parameter > process1 & > process2 & > TRAPCHLD() { > if (( ${#jobstates} == 0 && jobs_started )); then > print Last background job edited, doing something else... > trap -- CHLD > fi > } Sorry, remove "&& jobs_started". This implies you're in an interactive shell with job control --- it'll work in a function but not a script unless you "setopt monitor". pws