From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4900 invoked by alias); 24 Nov 2016 16:25:37 -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 4884 invoked by uid 89); 24 Nov 2016 16:25:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*r:192.168.3, H*F:U*cygwin, H*i:sk:3ca5423, H*f:sk:3ca5423 X-HELO: Ishtar.sc.tlinx.org Received: from ishtar.tlinx.org (HELO Ishtar.sc.tlinx.org) (173.164.175.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Nov 2016 16:25:36 +0000 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id uAOGP7Wp036213 for ; Thu, 24 Nov 2016 08:25:09 -0800 Message-ID: <58371478.2050700@tlinx.org> Date: Fri, 25 Nov 2016 12:24:00 -0000 From: "L. A. Walsh" User-Agent: Thunderbird MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: Broken bash command substitution References: <3ca54233-d36d-451f-459f-15f5c4b0d552@hongo.wide.ad.jp> In-Reply-To: <3ca54233-d36d-451f-459f-15f5c4b0d552@hongo.wide.ad.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00279.txt.bz2 Tydus wrote: > > Dear list, > > I use Cygwin64 for a long time and everything went well. However, after > one setup.exe update, the command substitution (`foo`) is broken on > bash. ---- You didn't specify what version of bash you are running. Since here: > $ ssh a-linux-server > $ A=`echo 123 | cat`; echo "===$A===" #<-- Linux doesn't have problem > either > ===123=== > $ exit --- You know that the main shell on linux is "bash". If it didn't happen on linux, that meant it didn't happen in the bash on that linux. What version of bash was it running? Problems in bash are specific to specific versions of bash -- so their version becomes important. Using "bash --version" should tell you. If the versions are different and the later version doesn't have your problem, something may have changed to fix the problem. Also, FWIW, when I try your example on cygwin, I got: > unset A; A=`echo 123 | cat`; echo "===$A===" ===123=== I.e - it seemed to work. Not that it makes a difference in your test case, but I think use of backticks has been replaced by a suggestion to use "$()", like: > unset A; A=$(echo 123|cat); echo "===$A===" ===123=== I think it was thought that "$()" hilighted the subprocess more clearly as well as making it more clear that the interior text is done in a sub process. FYI, my bash on cygwin is: > bash --version GNU bash, version 4.1.17(9)-release (x86_64-unknown-cygwin) -- 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