From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25631 invoked by alias); 26 Nov 2010 18:16:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28458 Received: (qmail 8742 invoked from network); 26 Nov 2010 18:16:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.215.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=BzHkxUOxbpKOO9+R84nK/nkHrK+ScoGqQ/8XkNAyVaY=; b=wWCBB+ceBNT1jNRtMNU3DTqMqsD+ByPocJaGTELdwZODbieyJ+LG0JzLPKY2RBh71/ 7AjfSzLFLKMNpEXl2jv8G7Ve9EkLDYg8r5Fmw8bYKU+v6Fd5fk7I5uv7WW6NWBKDhTiz 0ibuXHZqBpiE8jdtpPhrH27dJo73ZzaOvDMUI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=vTDP0o+2V3PAVUEPQexwkp4NxX7jCUWa3lUoZZJ7mytCV6JavoER0bROuBwbQXy9Cm hHOzh+lu35vHAbvMX3GIgvIQzoz5FpjR541SWgKgg6hDDWLes5/ylIOj3u0tZvvroCTz LecSAXnd/JHFAG5rE9t/IovQ+09R0lsVir22A= From: ZyX Reply-To: zyx.vim@gmail.com To: zsh-workers@zsh.org Subject: Re: `jobs' builtin does not work with pipe in scripts Date: Fri, 26 Nov 2010 21:16:14 +0300 User-Agent: KMail/1.13.5 (Linux/2.6.34-zen1; KDE/4.4.5; x86_64; ; ) References: <201011252341.44512@-zyx> <201011260738.12563@-zyx> <101126094739.ZM25971@torch.brasslantern.com> In-Reply-To: <101126094739.ZM25971@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2648039.6zZZGNFk24"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201011262116.15270@-zyx> --nextPart2648039.6zZZGNFk24 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Reply to message =ABRe: `jobs' builtin does not work with pipe in scripts= =BB,=20 sent 20:47:39 26 November 2010, Friday by Bart Schaefer: What is your version of zsh? It does not work for me: (zyx:~) % zsh -fc 'sleep 3 & fg' zsh:fg:1: no job control in this shell. (zyx:~) % zsh -omonitor -fc 'sleep 3 & fg' zsh:fg:1: no job control in this shell. (zyx:~) % zsh -fc 'setopt monitor;sleep 3 & fg' zsh:setopt:1: can't change option: monitor zsh:fg:1: no job control in this shell. And if zsh does not provide job control without this option, why `jobs' wor= ks as=20 expected without pipe? Original message: > On Nov 26, 7:38am, ZyX wrote: > } > } What more? `jobs -p | ...' is not working >=20 > If you want "jobs" to do something reliable, you have to set the > MONITOR option. Zsh by default does not provide job control in a > non-interactive shell. >=20 > % zsh -fc 'sleep 3 & fg' > zsh:fg:1: no job control in this shell. > % zsh -fc 'setopt monitor; sleep 3 & fg' > [1] 25945 > [1] + running sleep 3 > % zsh -fc 'sleep 3 & jobs -p | sed s/run/RUN/' > % zsh -o monitor -fc 'sleep 3 & jobs -p | s/run/RUN/' > [1] 25967 > [1] + 25967 RUNning sleep 3 > % --nextPart2648039.6zZZGNFk24 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEABECAAYFAkzv+W8ACgkQkOgHluiXxU8+TwCfdHjrUpRi7wzQ6j91qIK4yl6L s5gAoIY32C56z3nKgvpMYfwB7U+9L21C =v2Pb -----END PGP SIGNATURE----- --nextPart2648039.6zZZGNFk24--