X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:from:date:message-id:subject:to
	:content-type; q=dns; s=default; b=eXyn2nWRpTBuncwmg12hmVbFAf8IV
	otpPSi1UQG7LaN40t8riz4BHleZJzkRioKNDE3CdP70/YmAXCFO/wRjgfWSNjxFp
	iMPEMdhPCWfk6AHFjX/Up4EWrBCTof79xHjzfIL/1hoR8fYBN3t5p/jFN2DMpCp5
	SpEbJOZYubAeY0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:from:date:message-id:subject:to
	:content-type; s=default; bh=y2L6SkglmEWtb8O4J/odwPYmaiY=; b=Qka
	kqp91rnVLJ138zTDba0TdYmgTm5eBFztM2B1OcH0fYRP7XohIrdbNfZcRBKTqjU0
	+EUGbV2VUGP2/JZWP46hSlzUB3SJVi9E0razDPmy/pCp4aJIHmxwHVV53F00xRWy
	BEzmmBy/JXOOzV/zTQlQCns9Yb3Z6CWlUnN6t6dc=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=arrow, HX-Received:Wed, instincts, keys
X-HELO: mail-pg0-f45.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20161025;        h=x-gm-message-state:mime-version:from:date:message-id:subject:to;        bh=kPPWwOzSdwZhDgY05icWaUDJm+XRZ6Noxuojo8DwKUE=;        b=qe2molT5Bf640jY16tYtH+m4p2h+BGnHblz8lFTPGrv3+Ms4ElpiogSUp/xybnBcUX         I0e6QLkFhoSNVuCiOgholUqMW9+LggQN/7pS2sP6wzJkJDYB33baL+2K2KktY6VZsVtG         2dPBq4y9MN26kb+QxBGNUNC4rZD/vsFs3On0iTcHTfwxo0EHAC2Nz4J9EbMkVOqVamw7         qezGNadyUS8TKU7w/fe0HsCGHj2LJIoQvC4vX004ZBqueSG+fZ8AzKHC/T0HMvOk46dM         wIfXRl7pFQAd/hsnM7wAAYvrLrxcwvYLRE3cMlMzlx7VrzIYlclMZA28SCq08qrFFuBc         n9aQ==
X-Gm-Message-State: AKS2vOxVQ+7ZLqJFOxcBoXOOyoAatZtGLw7UDA7yqYDGCbPf2bDVCNak	o39fB+U7NnJApJasbfT5T7CFpmlVVWHg6pSoSQ==
X-Received: by 10.84.195.1 with SMTP id i1mr3556135pld.120.1497426109787; Wed, 14 Jun 2017 00:41:49 -0700 (PDT)
MIME-Version: 1.0
From: Jon Bord <namebookcoverjudge@gmail.com>
Date: Wed, 14 Jun 2017 09:41:49 +0200
Message-ID: <CAMwBcu5zQkiSRJQp9sPM5_n=emNzskk9Nk4dfQfGGe7fgOFEQQ@mail.gmail.com>
Subject: Pipe after Command Substitution does not resolve the substitution:
To: cygwin@cygwin.com
Content-Type: text/plain; charset="UTF-8"

Hi,

This is the first time i've ever submitted a bug report so i hope the
below is ok. I am not a programmer although i do do some scripting.

The below is the kind of 'command substitution then pipe' that i often
used in Cygwin on Windows 7.  Now that i've been forced to move to
Windows 10 it no longer seems to work. I'm assuming that this is not a
feature of an upgraded Bash but maybe i'm wrong, eg maybe we are now
supposed to put everything in variables rather than use command
substitution.

Windows 10
bash 4.4.11(2) and 4.4.12(3)

$ set -xv

(EXAMPLE 1: COMMAND SUBSTITUTION WORKS AS EXPECTED)
$ grep 2 $(ls | tail -1)
grep 2 $(ls | tail -1)
++ ls
++ tail -1
+ grep 2 test.txt
2
23

(EXAMPLE 2: HANGS)
$ grep 2 $(ls | tail -1)  | grep 3
grep 2 $(ls | tail -1)  | grep 3
+ grep 3
+ grep 2

(EXAMPLE 3: HANGS)
$ grep 2 `ls | tail -1` | grep 3
grep 2 `ls | tail -1` | grep 3
+ grep 3
+ grep 2

Would it be correct to conclude from the above output that once the
pipe is added then it is ignoring the substitution?

SPECULATION: i had wondered if the cause was a change in version of
bash but i cannot be sure what the version was that i was using on
Windows 7. I wish i had a record. I've tried this on both 4.4.11(2)
and 4.4.12(3). My instincts are that it is not, that it is Cygwin (or
more precisely bash.exe?) on Windows 10 instead. I have noticed other
differences / problems, eg arrow keys behaving oddly in vi, and
general sluggishness (but not tested yet).

Many thanks for any help and i hope this can contribute to keeping
Cygwin strong.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

