From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Samer Masterson Newsgroups: gmane.emacs.bugs Subject: bug#12689: 24.2; Eshell ${cmd} substitution Date: Thu, 05 Mar 2015 02:34:00 -0800 Message-ID: <1425551640.2108.1@mail.samertm.com> References: <1424775372.11596.6@mail.samertm.com> <83bnkaqdp9.fsf@gnu.org> <1425471247.1450.2@mail.samertm.com> <83ioegpsrt.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-wakbot8dxsMXbfS7cYam" X-Trace: ger.gmane.org 1425551724 17215 80.91.229.3 (5 Mar 2015 10:35:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Mar 2015 10:35:24 +0000 (UTC) Cc: 12689@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 05 11:35:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YTT7X-00083b-0r for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Mar 2015 11:35:11 +0100 Original-Received: from localhost ([::1]:50899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTT7W-0002ME-DK for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Mar 2015 05:35:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTT7S-0002Jg-0h for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2015 05:35:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTT7O-0002ru-Q4 for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2015 05:35:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTT7O-0002qW-NG for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2015 05:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YTT7N-0000pb-QS for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2015 05:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Samer Masterson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Mar 2015 10:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12689 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12689-submit@debbugs.gnu.org id=B12689.14255516593138 (code B ref 12689); Thu, 05 Mar 2015 10:35:01 +0000 Original-Received: (at 12689) by debbugs.gnu.org; 5 Mar 2015 10:34:19 +0000 Original-Received: from localhost ([127.0.0.1]:35655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YTT6g-0000oW-DK for submit@debbugs.gnu.org; Thu, 05 Mar 2015 05:34:19 -0500 Original-Received: from ec2-52-0-7-12.compute-1.amazonaws.com ([52.0.7.12]:35537 helo=samertm.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YTT6e-0000oI-Fc for 12689@debbugs.gnu.org; Thu, 05 Mar 2015 05:34:17 -0500 Original-Received: from [10.1.10.16] (c-98-210-154-226.hsd1.ca.comcast.net [98.210.154.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by samertm.com (Postfix) with ESMTPSA id EABE742D22; Thu, 5 Mar 2015 10:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samertm.com; s=mail; t=1425551635; bh=SSNoc9BY8bhBKcKP7Sf9k/5EOzqJ2GnZK7AcW2WnaZY=; h=Date:From:Subject:To:Cc:In-Reply-To:References:From; b=ljAXDlx/WHO+KWCesXuxsFQj2IzO9Cv1i2uBd7625PLuiC8PqvubHhfT6+NB8po7v dbzI36vexIM+Q7o4MeV5m5SZU2Wcm+KRaCnWRoEzEC7fi9KDOWpSjrglNuVTl0O4Nv plPveOOFzgPfRQXP6CpqIEuj3RNgoU3mmlyAIGNU= In-Reply-To: <83ioegpsrt.fsf@gnu.org> X-Mailer: geary/0.9.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100088 Archived-At: --=-wakbot8dxsMXbfS7cYam Content-Type: text/plain; charset=utf-8; format=flowed On Wed, Mar 4, 2015 at 9:38 AM, Eli Zaretskii wrote: > eshell-execute-pipeline was what I had in mind. > > It's been a while since I last hacked Eshell, so perhaps that was a > stupid question, but what prompted it was the fact that your change > would wait until a process exited under some conditions, so I wondered > whether it will prevent Eshell from firing up several asynchronous > processes connected through a pipe. Oh, I see what you're saying. My confusion came from not knowing that piped programs executed in parallel in traditional shells. > > Not sure why you intersperse internal and external echo, or why did > you use echo to begin with. I thought the external echos would race and output out-of-order, but they just cut off after the first external echo. > I'd rather see that a pipe that does make sense, something like > > cat some-large-file | wc > > with external commands works as expected, and both programs run > simultaneously in parallel (e.g., according to 'top' or a similar > tool), not sequentially. The following command ~$ sleep 1 | sleep 1 | sleep 1 runs in 1 second without my patch and 3 with it (which doesn't conform with Bash). Also ~$ cat any-file | wc never returns with my patch. Thanks for catching these errors, and I'll ping this bug report when my new patch is ready. -s --=-wakbot8dxsMXbfS7cYam Content-Type: text/html; charset=utf-8
On Wed, Mar 4, 2015 at 9:38 AM, Eli Zaretskii <eliz@gnu.org> wrote:
eshell-execute-pipeline was what I had in mind. It's been a while since I last hacked Eshell, so perhaps that was a stupid question, but what prompted it was the fact that your change would wait until a process exited under some conditions, so I wondered whether it will prevent Eshell from firing up several asynchronous processes connected through a pipe.

Oh, I see what you're saying. My confusion came from not knowing that piped programs executed in parallel in traditional shells.
Not sure why you intersperse internal and external echo, or why did you use echo to begin with.
I thought the external echos would race and output out-of-order, but they just cut off after the first external echo.
I'd rather see that a pipe that does make sense, something like cat some-large-file | wc with external commands works as expected, and both programs run simultaneously in parallel (e.g., according to 'top' or a similar tool), not sequentially.
The following command

~$ sleep 1 | sleep 1 | sleep 1

runs in 1 second without my patch and 3 with it (which doesn't conform with Bash). Also

~$ cat any-file | wc

never returns with my patch. Thanks for catching these errors, and I'll ping this bug report when my new patch is ready.
-s
--=-wakbot8dxsMXbfS7cYam--