delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/11/24/11:25:52

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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=W+h9dX6Vdo9hdZ6gI3B5+cjWBsGJXx0XB9HgSZ0O86j
9MtjvVLelSlLbtHVD+4T0GERkaLG9fd4lD/5+tJMd4rPQx702q5fFOmj5Esi8wpQ
2gOGoW/HcIlu7oUgNtnojIx74TMqXwMeALvxoBs8idxiNBQAipYZqyuph3TOyFcA
=
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:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=1bmhe8wxHIVr+pRZ9mHojrILiB4=; b=s4oFuOfqdyMC5lIKu
RVd7wQ0Azq8gSQ9oORBJJ92Kg/7nPxOjMGz+OMkmKI+xEV9wip+qx1zU3W4oR8lm
g8eaRMt9W8AL4I+lYTLGSt8p/ybml2Rx5PPBoVvFY1ZySQtESRZJJAUuoGD73vzU
YFlYKc6y63mHdEt+vY6U6pDf7s=
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=-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
Message-ID: <58371478.2050700@tlinx.org>
Date: Thu, 24 Nov 2016 08:25:28 -0800
From: "L. A. Walsh" <cygwin AT tlinx DOT org>
User-Agent: Thunderbird
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Broken bash command substitution
References: <3ca54233-d36d-451f-459f-15f5c4b0d552 AT hongo DOT wide DOT ad DOT jp>
In-Reply-To: <3ca54233-d36d-451f-459f-15f5c4b0d552@hongo.wide.ad.jp>
X-IsSubscribed: yes

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

- Raw text -


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