delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/06/14/06:34:37

X-Recipient: archive-cygwin AT delorie DOT 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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=L9lt/D+ylISI5v+r
TcOR6HchcRwbqjafPzv5fOcLdjbN8VJOv2N3BiGeCBRV+MRT+774DbhssgvsI+Wm
1tnC+or43eC3Mm9QNKiUom3CwELw2ZueHOCSxtUcr75zdE+8n0CQYbZLwG9IxULr
IbCU+M5dAnAM0W9Mv4tZdKByEKM=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=RuqbJXpUQvOq5lGAtkk6Fi
ZwfpY=; b=rCiG2O1ES1lQLIk88WmimC4ACAD3NfglbrnurZWnSCGkeMUjFYLdLQ
ZbGv92oIthr3KcZm73Nh1fK7GiaxqWiDjta7VGKxa0TWoa/5h2elzJvg1X7n4Q9g
hFmRw9PDldF23J9OdNYkRDz7ArUNGPbBBrfZMtm9dXLqV8NYlizdA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:69bd
X-HELO: mail-it0-f47.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=eJK7eV+Bh8Zd8G8Ro8ujH1Xi2EyT7z6SDiOu+fRlIf0=; b=e9Rfhag1AZO4c1j0pDKWq1+2YGwmz653ianC+HIskUM8olHWxN+CslHr9KnZUmjWyr pI620dMrrl96xNlo7SoJUpU/cpCj4fBh0LtoL3KuufKMJoOH/gbZ0cbj6zBBOz16uVES liu0P0ZlI9cYm7r01XWsbyYF7G9h5HbXykOWQdB5uDmxDGbjlO2gXF42Xrhf7JzZfX63 arvEXE757ZroMzo71o0C9yqbIIFCu1jBpxZN+bvgCXscAFBAv3smXciXM3IliHHntcQI cZnLd+n4N0WJwbS/PR2PgclvyFF1UJTeUc9+2FkxRXTwnksY4ipBfMGMXvIigBmd7SxD VNMQ==
X-Gm-Message-State: AODbwcCBow6AjvJvgjWD85gFW3f22dZZVcSNE7RM8u7NiyIRJK+A/jS+ 6lfEgbCePWq0+MqO478=
X-Received: by 10.36.43.146 with SMTP id h140mr22006574ita.7.1497436457446; Wed, 14 Jun 2017 03:34:17 -0700 (PDT)
Subject: Re: Pipe after Command Substitution does not resolve the substitution:
To: cygwin AT cygwin DOT com
References: <CAMwBcu5zQkiSRJQp9sPM5_n=emNzskk9Nk4dfQfGGe7fgOFEQQ AT mail DOT gmail DOT com>
From: Marco Atzeri <marco DOT atzeri AT gmail DOT com>
Message-ID: <be374781-69bd-e226-33d6-7ca1426d02ce@gmail.com>
Date: Wed, 14 Jun 2017 12:34:00 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CAMwBcu5zQkiSRJQp9sPM5_n=emNzskk9Nk4dfQfGGe7fgOFEQQ@mail.gmail.com>
X-IsSubscribed: yes

On 14/06/2017 09:41, Jon Bord wrote:
> 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?
>

Hi Jon,
all the examples work for me on W7 64 with cygwin 64bit.

  $ ls
prova.txt

$ cat prova.txt
1
2
3
23

$ grep 2 $(ls | tail -1)
2
23

$ grep 2 $(ls | tail -1)  | grep 3
23

$ grep 2 `ls | tail -1` | grep 3
23

can you provide your cygcheck.out  ?
Problem reports:       http://cygwin.com/problems.html



--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019