From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23659 invoked by alias); 14 Jun 2017 10:34:17 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 23638 invoked by uid 89); 14 Jun 2017 10:34:16 -0000 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 Received: from mail-it0-f47.google.com (HELO mail-it0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Jun 2017 10:34:14 +0000 Received: by mail-it0-f47.google.com with SMTP id x129so5442018ite.0 for ; Wed, 14 Jun 2017 03:34:19 -0700 (PDT) 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) Received: from [10.0.2.102] ([173.243.47.90]) by smtp.googlemail.com with ESMTPSA id i6sm7106912iti.20.2017.06.14.03.34.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jun 2017 03:34:16 -0700 (PDT) Subject: Re: Pipe after Command Substitution does not resolve the substitution: To: cygwin@cygwin.com References: From: Marco Atzeri Message-ID: Date: Wed, 14 Jun 2017 10:34:00 -0000 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00143.txt.bz2 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