This is the mail archive of the
mailing list for the Cygwin project.
Re: Broken bash command substitution
- From: "L. A. Walsh" <cygwin at tlinx dot org>
- To: cygwin at cygwin dot com
- Date: Thu, 24 Nov 2016 08:25:28 -0800
- Subject: Re: Broken bash command substitution
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com>
I use Cygwin64 for a long time and everything went well. However, after
one setup.exe update, the command substitution (`foo`) is broken on
You didn't specify what version of bash you are running.
$ ssh a-linux-server
$ A=`echo 123 | cat`; echo "===$A===" #<-- Linux doesn't have problem
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
unset A; A=`echo 123 | cat`; echo "===$A==="
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==="
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
FYI, my bash on cygwin is:
GNU bash, version 4.1.17(9)-release (x86_64-unknown-cygwin)
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple