From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11977 invoked by alias); 25 Mar 2018 07:38:59 -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: List-Unsubscribe: X-Seq: 42528 Received: (qmail 18898 invoked by uid 1010); 25 Mar 2018 07:38:59 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f178.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.128.178):SA:0(-1.9/5.0):. Processed in 0.475568 secs); 25 Mar 2018 07:38:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=m+EBy/vRAdcfy4kbQTtJFYzg82WF3PCTbbEkJIKUMz4=; b=PwulIEVQam2tpO+roVXf2zlGDxlhY5IYQbJKmOo78AvRi14foftrJ3VF4Q0tcIK+rE ihJkAiYvNg0bVv5Fx4emHo9wCExZ3YJyANQAGqwv0OugF6FVxIF4Dyj/H0ygz7LrRw3Y VFGnOvhQYiK2hvKu9O1ttiGJBAJ9n0qGZOyq/lF9nvQALkoHqekbBlq6VCTs1+J1lgQh iWnWb+XgvA2oKlO6aYIuyPE94pmOat6nB/TcIjAgkGXRSJukPO03VxkkAnI2Xvojb0Yb BxtK0cw0J2xXgk1dGmzk6bylNAEZa2oJfHgBhVzxL+a/RKPQjVv/Hn+FijKpMwwxNceK A9LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=m+EBy/vRAdcfy4kbQTtJFYzg82WF3PCTbbEkJIKUMz4=; b=jFtJFomqvel/vYeb4yw052cTSFJqXu7Ac3VQVRDogH/S/x0HTKhYRCxOztDvh5+dPi vjUyzxZ0wa2BfzEuycoGVwffG141NGg/G/9ecEeP9JdagvXeSHsHkOtkqohzN+k7/X20 nColSXmc2sWhQ3kMfAlw+bNVV2TKiCkrCmzyk1iUu/u1s1fmlmxEPKnyqYpo/YeqXi/q fMjkqAuW2kH0WLEQKUdzF/djqs9ucvWBrrvw6TAKgTPjcqyGZKUl2obPQt385BypLMEd 6d+5MPp6s31rxDVD0e6oYTeyafWU0DmAE8x+0IcmiR6iz5Sw31EEy1aI27myey5/t9Oy z5lA== X-Gm-Message-State: AElRT7Hbw5XmCwoFU0yZM4/yJyt0HD4Tb0kns07dnv6NBATcIEelxMsO dQDSPPyGyBUrui0aPmhmR1Kw6A== X-Google-Smtp-Source: AG47ELv2UDzF0XwopA5vRYkQNuqfP6FFu1S9NeukN4e9ljKIgfoOeRxYcnW1N8o/0AuF6yRPJx7vuw== X-Received: by 10.223.130.50 with SMTP id 47mr12543723wrb.99.1521963534857; Sun, 25 Mar 2018 00:38:54 -0700 (PDT) Date: Sun, 25 Mar 2018 08:38:53 +0100 From: Stephane Chazelas To: Zsh hackers list Subject: Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups Message-ID: <20180325073853.GA7561@chaz.gmail.com> Mail-Followup-To: Zsh hackers list References: <20180323161612.GB4857@chaz.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180323161612.GB4857@chaz.gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) 2018-03-23 16:16:13 +0000, Stephane Chazelas: [...] > - the first pipeline component must be a builtin or compound command To clarify, as explained by Bart, it doesn't have to be builtin. It's more easily reproducible with builtins as they exit quickly but one just needs a command that exits before the command substitution as in: sleep 1 | ps -j $(sleep 2) | cat|cat|cat... Another side effect is that echo test | tee $(uname) | sleep 10 | cat cannot be aborted with ^C as only "cat" is in foreground (echo gone, tee (soon gone too) and sleep on their own process group). Also, ^Z suspends cat only causing a deadlock. That's probably a worse problem and could explain the similar lock ups I sometimes experience in zsh. > - the second component must have a command substitution in the > arguments (OK when in targets of redirections). [...] Following-up on my previous email, that means: $ n=1; echo $((++n)) | cat; echo $n 2 2 $ n=1; echo > $((++n)) | cat; echo $n 1 Which looks a bit inconsistent. -- Stephane