public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "L. A. Walsh" <cygwin@tlinx.org>
To: cygwin@cygwin.com
Subject: Re: Broken bash command substitution
Date: Fri, 25 Nov 2016 12:24:00 -0000	[thread overview]
Message-ID: <58371478.2050700@tlinx.org> (raw)
In-Reply-To: <3ca54233-d36d-451f-459f-15f5c4b0d552@hongo.wide.ad.jp>

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

  reply	other threads:[~2016-11-24 16:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25  2:50 Tydus
2016-11-25 12:24 ` L. A. Walsh [this message]
2016-11-25 19:54   ` Gerrit Haase
2016-11-27 22:42     ` L. A. Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58371478.2050700@tlinx.org \
    --to=cygwin@tlinx.org \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).