From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17382 invoked by alias); 17 Apr 2018 16:36:20 -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: 42674 Received: (qmail 22169 invoked by uid 1010); 17 Apr 2018 16:36:20 -0000 X-Qmail-Scanner-Diagnostics: from mailout2.w1.samsung.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(210.118.77.12):SA:0(-1.9/5.0):. Processed in 13.498882 secs); 17 Apr 2018 16:36:20 -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,SPF_HELO_PASS, SPF_PASS,T_DKIMWL_WL_HIGH,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180417163601euoutp0270eafc67e3cd1bc2517854752e1077ce~mRm3tB_Gs2487324873euoutp02I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1523982961; bh=2Q9g6zdNG3+Jcl41e5uVWBTZ48NZzWeNVWDboai1354=; h=Date:From:To:Subject:In-reply-to:References:From; b=j1U80MBkPLhja8iQ8YX130oYn71MYuW0RwIZ3EO4L57BlM+z1FaCO3d3qfnh6OEUQ r9wXLbuYl9ZQtYeeQTfv7LuWUTlT2ahGKoBb7Nzvxn+zMWUEBfR+Xb0b+BreKme6EH dvgfznX5j3Yu1Vqdtr94Fs7H7ML/u6NDmICffIEo= X-AuditID: cbfec7f5-b5fff700000028a9-36-5ad62270d037 Date: Tue, 17 Apr 2018 17:35:58 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups Message-id: <20180417173558.769503bd@camnpupstephen.cam.scsc.local> In-reply-to: <180417090926.ZM2456@torch.brasslantern.com> Organization: SCSC X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMIsWRmVeSWpSXmKPExsWy7djPc7oFSteiDC4vMrU42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGdP/bWMu+CVc0bRzLXMD4yf+LkZODgkBE4nGxffZuxi5OIQE VjBKbFkwG8rpZZL4fGgraxcjB1jVy0slIA1CAssYJc4sZYaomcYkce/6KVYI5wyjxPrrv6Cc C4wSr7ZPYgTpZhFQlVi3qRSkm03AUGLqptmMILaIgLjE2bXnWUBsYYEEibN7djCB2LwCzhL/ 7+4Ai3MKWErcnvmfGWQMv4CQxIVmW4ir7SWO7jkJVS4o8WPyPbByZgEdiW3bHrND2PISm9e8 BTtUQmAGm0TH2uVsEM0uErMW32KCsIUlXh3fwg5hy0h0dhxkgmhoZpRYe/8+VEMPI1BHKIRt LdF3+yIjxAY+iUnbpjNDQohXoqNNCKLEQ+Lapc9QMx0lVu1tg4bJX1aJv307GScwys9Ccvgs JIfPQnL4AkbmVYziqaXFuempxcZ5qeV6xYm5xaV56XrJ+bmbGIFRf/rf8a87GPf9STrEKMDB qMTDu0DgWpQQa2JZcWXuIUYJDmYlEd6dj69ECfGmJFZWpRblxxeV5qQWH2KU5mBREueN06iL EhJITyxJzU5NLUgtgskycXBKNTCyf9AKjz5/7Kje1WmnKg4wX/CxzZjIkOn47+sbjS+iZ+zt vsrtnul7wVf8WfUZgwXeJobSy7byZG887sV+yW0rk7HvhUWN3VEHcv5dmpq3sCz96V6+I5sK 1JZ2RjZ3HXEu6vkg3vd1ZhzX0uPbt7+uWxbz8nDpPoOYnEcbgre/c58UfHrWMutdSizFGYmG WsxFxYkAtK6dDfYCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsVy+t/xa7oFSteiDK5ukrU42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGdP/bWMu+CVc0bRzLXMD4yf+LkYODgkBE4mXl0q6GLk4hASW MEpMuHWfEcKZwSTxoP8+K4RzjlGi+9FVqMwFRonTC6YzgbSzCKhKrNtU2sXIycEmYCgxddNs RhBbREBc4uza8ywgtrBAgsSiJxPA4rwCzhL/7+4Ai3MKWErcnvmfGWLmX1aJw9c62UFm8gsI SVxotgWpkRCwlzi65yQTRK+gxI/J98B6mQW0JDZva2KFsOUlNq95ywxiCwmoS9y4u5t9AqPQ LCQts5C0zELSsoCReRWjSGppcW56brGhXnFibnFpXrpecn7uJkZgyG479nPzDsZLG4MPMQpw MCrx8C4QuBYlxJpYVlyZe4hRgoNZSYR35+MrUUK8KYmVValF+fFFpTmpxYcYpTlYlMR5zxtU RgkJpCeWpGanphakFsFkmTg4pRoY+7PUGMMTO6ODXhoIXjhtJeS0cPZ3o2r2j8K11cu8Jm/Y oPV5o4/yuSlre9yuh9UzPrxpUZrz9/DxExyfrjx8vndz7417n++fsvtcuzqyeSWn8fQWF45Z m403BXv9zTvx+rG+ikgW18anJpNXPAz6kiDbVj/tvo/xhfIDlWm3nmwy3XTpX/iGfUosxRmJ hlrMRcWJAL51rLFVAgAA X-CMS-MailID: 20180417163600eucas1p1e7b7fc51a471acaca6b1083978791551 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180324221021epcas1p184507a6328dbd505b97db69c1f9d8194 X-RootMTR: 20180324221021epcas1p184507a6328dbd505b97db69c1f9d8194 References: <180323221959.ZM27569@torch.brasslantern.com> <20180324080514.txxyrb3qiztu4pqt@gmail.com> <180324150945.ZM32251@torch.brasslantern.com> <20180410124545.13fccd5d@camnpupstephen.cam.scsc.local> <20180410145926.64c4f671@camnpupstephen.cam.scsc.local> <180411151025.ZM19332@torch.brasslantern.com> <20180412172342.52df6b10@camnpupstephen.cam.scsc.local> <20180415162326.GA12549@chaz.gmail.com> <20180415185804.GB12549@chaz.gmail.com> <180416223910.ZM32002@torch.brasslantern.com> <20180417101947.5fd347df@camnpupstephen.cam.scsc.local> <180417090926.ZM2456@torch.brasslantern.com> On Tue, 17 Apr 2018 09:09:26 -0700 Bart Schaefer wrote: > On Apr 17, 10:19am, Peter Stephenson wrote: > } Subject: Re: "echo | ps -j $(:) | cat | cat | cat" runs components > in diff } > } On Mon, 16 Apr 2018 22:39:10 -0700 > } Bart Schaefer wrote: > } > So if, when we determine that "&" is the command separator, we > could } > treat the command in the way the "time" prefix does, this > would all } > work out without mangling execcmd_exec() and prefork(). > } > } That's good, I think that's probably worth doing. > } > } I think it would be fine to change with a note about the > } incompatibility. > > Glad to hear that, however, I have very few clues about zsh wordcode > (or in particular about how to put something into the wordcode back > at the beginning of the command when we reach the separator at the > end) so I'm not likely to be able to change this myself. It's the whole structure of the parsing rather than the resulting word code (though of course the effect is encoded there). When "time" is parsed we're at the level of a command, but instead of treating the arguments as a command (which wouldn't work as we need to time am entire pipeline), the parser recursively parses a nested pipeline (essentially --- it's actually called "sublist2" in the parser because it can have "coproc" or "!" in front, which also apply to the whole pipeline). The fork then happens at the level of the "time" command handling --- because the "&" is parsed at the level of the list that includes the time and its arguments, not the nested pipeline --- leaving the entire pipeline after it to be run in the subshell from within the execution environment for the time command (exectime()). The ampersand is therefore parsed rather late to be able to see you need this structure. So it probably needs some other trick --- a different list marker that causes a special null command akin to time to do the fork, for example, as it's easy to update word code tokens when the structure doesn't change. The logic would then be within the exec code, based on detecting the new token, rather than by restructuring the word code. Not actually very neat internally. > There's also workers/42233 and related thread, if we're already going > to be fiddling with wordcode. (Limitations on the size of a script it > is possible to zcompile.) I think we demonstrated fairly conclusively that no one has the faintest clue what's happening here. pws