This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Setting a bash variable from backtick operator fails
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Numien <numien at deathwyrm dot com>, cygwin at cygwin dot com
- Date: Tue, 27 Feb 2018 17:47:41 +0300
- Subject: Re: Setting a bash variable from backtick operator fails
- Authentication-results: sourceware.org; auth=none
- Authentication-results: smtp2o.mail.yandex.net; dkim=pass header.i=@yandex.ru
- References: <29d3fea9-89e2-0eab-8bba-486b25fa875b@deathwyrm.com>
- Reply-to: cygwin at cygwin dot com
Greetings, Numien!
> While working on diagnosing an issue with autotools, I found Cygwin's
> bash seems to not be able to set a variable from backtick substitution,
> at least on my system (Cygwin x86_64, updated today, on Win10)
> On a Linux system it works as expected:
> $ test=`echo "x86_64-pc-cygwin" | sed 's/-[^-]*$//'`; echo $test
> x86_64-pc
> On a Cygwin system it doesn't:
> $ test=`echo "x86_64-pc-cygwin" | sed 's/-[^-]*$//'`; echo $test
> (no output)
I'm unable to reproduce it here.
> This also happens in scripts (where I originally encountered the
> problem), not just on the command line.
> Directly outputting it (echo `echo "x86_64-pc-cygwin" | sed
> 's/-[^-]*$//'`) works fine, it seems to be specifically related to
> setting a variable.
> Any suggestions?
Any BLODA?
--
With best regards,
Andrey Repin
Tuesday, February 27, 2018 17:47:03
Sorry for my terrible english...
--
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