delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/02/27/09:46:49

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:subject:to:references:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=p58SV4Z2HD0yu0gg
SfXgR4khVIPDn4xxYB8aLL1ir+ihQXL2oi9+H1agmq6lGv2jgUz6RdCh0smxo8zm
qwFhogNYI0jOAc026FlyBvtuSEcJPqVI8b+4UG4Lm9okOGOBJOpseXwXw+TInync
P50D/ruJC/bKMkegRi6+nbZIQio=
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:subject:to:references:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=6K0G51NvbBKqZ/jOF5kNuf
yPMjs=; b=kvfkNXOg+cy2/U/rcFHQEKkz6tQEITlKPEVYsyi97wXmpl0QfwnMj4
ZSlwYu3AIj0nYtu5/qfuTrUOQCHg9W0hmKgskh6lCVdb+PtUbf7QYCFM0dOk4Wml
t6t6Hza/XgLxfJN/24kOKvgmencCv/tRDAjybkL+nyQmNMKZ+lQ8s=
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=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=cygwin_nt100, cygwin_nt-10.0, CYGWIN_NT100, backtick
X-HELO: mail-io0-f181.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:reply-to:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=r1Hu0WpviMkOCpXbWQSKJPFcqw80gcRSLpD689x0s+Q=; b=I+e3UV4Voqm0JsOZtOlcfixZlzFBpSe2gmcCKT9pJlSpi39JUoTDm/HLVWMQeEwlAd 6rFV0ds4VAfPR+D4M6ilIeREX0S9WcFgVivhA2znJJ2Id4bzgdqgeXq/iQgSS+23edOS UVU7C1UJarai7ZYqA6BeQ8nVWYySnFf0H7WcUYi1AzJSSgn4mVVnCRXOgaIhqE2p1mCQ gD/LlnIfmkB0SqFiJYTbgk4V/nuAe7rjwHR2OHbBtQGDPZJo7wx0EP9gqy58eoOuQjnu 8T6eMsqw3EHXseZ0kxhdyDsoJN3Y+PZ6BQUYHhEzrbvSUFxzyooPhhWMkKv+ZqAQLCZ8 SW9w==
X-Gm-Message-State: APf1xPC7ai2Or9KgTWhNYoHI12/UjOMlRnvIAAGGv93I/GgXtJ6eBD+2 SCVi2QifaNjvnj++2cQht/WTAg==
X-Google-Smtp-Source: AG47ELtZYY0Egt6CLd5DuiSdenw0PyS3te8vttTmWlgy+bOkVpgBsDKWcMNcYt/qTT9K6eA0w9+GOQ==
X-Received: by 10.107.151.209 with SMTP id z200mr10133495iod.150.1519742789606; Tue, 27 Feb 2018 06:46:29 -0800 (PST)
Subject: Re: Setting a bash variable from backtick operator fails
To: cygwin AT cygwin DOT com
References: <29d3fea9-89e2-0eab-8bba-486b25fa875b AT deathwyrm DOT com>
From: cyg Simple <cygsimple AT gmail DOT com>
Reply-To: cygwin AT cygwin DOT com
Message-ID: <5b929eb3-4d3d-e69d-a13e-108b63be0424@gmail.com>
Date: Tue, 27 Feb 2018 09:46:16 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <29d3fea9-89e2-0eab-8bba-486b25fa875b@deathwyrm.com>
X-IsSubscribed: yes

On 2/27/2018 9:12 AM, Numien wrote:
> 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)
> 

Can anyone else confirm this?  My version just works but I can't update
to a newer version for another couple of days.

$ uname -a
CYGWIN_NT-10.0 eboyd53ent-lt1 2.9.0(0.318/5/3) 2017-09-12 10:18 x86_64
Cygwin


> 
> 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?

Try as a simple test:
$ PATH=/usr/bin test=`echo "x86_64-pc-cygwin" | sed 's/-[^-]*$//'`; echo
$test

Maybe something in your environment is causing it and this would remove
the potential of something not Cygwin in the way.

-- 
cyg Simple

--
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