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

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:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=UWYX4Cpd91eVGktW
W9oVKMTwCWrPj/GIYnUqAKUfVrVgHBdS/Rl7xjLzlwdJatkadzifHN5T9rQFV/7Y
sFSot5mzomZNlDmDN8nv0C3R75bcPbomZeCAnqEGrGMEqQQ1IF7+eTTaEQtNdkOG
CqYxfXOk6wfhuXAmpb8E3lGCAlE=
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:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=lI0QFCEZ2WFh4oXxdRS1gD
EAtGM=; b=e1Tl6nPIABHV2I84dDbNqWrgxa/P5byDUfPUzi+HWprhtPZbCZaXjA
9Hz0aMxf3BD38gJso8SpyJiI9u6wPcWk9rJm+ghUle+TEEEH/F2kVfBtk/EVAM69
VNfZeMXk9KMkcZ50K3Yn7rqejLbUWu/e7F473DoGDJ7C5UYvi3pLc=
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,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=calgary, H*r:ip*192.168.1.100, Calgary, Alberta
X-HELO: smtp-out-so.shaw.ca
X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=N659UExz7-8A:10 a=b4eMD0GmHX_ZvWjD-W0A:9 a=pILNOxqGKmIA:10
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
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: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Message-ID: <5eef55ff-d8aa-7c27-7d80-c03021f6f564@SystematicSw.ab.ca>
Date: Tue, 27 Feb 2018 08:46:36 -0700
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-CMAE-Envelope: MS4wfIzY+nVF6esmEE1p/RFma3sjlK9t01cHrNvc3yZcDIL4syD5jC8gNzwx63LioSpEIgMjkUR0wQA9DnMSiSaqdm7zVRwf4XU5OU1WKjZpWuTWfFSzLFzq O9dXIZ8JCchmIHOhWQ9jS6TdyXEqRpp27E6yjgsNaXipxkIqga/+0/rED13loT2ah88JquirFUfqYg==
X-IsSubscribed: yes

On 2018-02-27 07:12, 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)

WJFFM:

$ uname -srvmo
CYGWIN_NT-10.0 2.10.0(0.325/5/3) 2018-02-02 15:16 x86_64 Cygwin
$ test=`echo "x86_64-pc-cygwin" | sed 's/-[^-]*$//'`; echo $test
x86_64-pc

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

Incompatible keyboard or console locale, terminal, .inputrc, or shell settings;
shell variable test set with incompatible attributes in profile; AV -
disable/bypass?

$ locale
LANG=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_ALL=en_CA.UTF-8
$ echo $TERM
xterm-256color
$ echo $SHELL
/bin/bash
$ declare -p INPUTRC
-bash: declare: INPUTRC: not found
$ bind -lpsvX
... lots of output
$ set
... lots of output
$ declare -p test
declare -- test="x86_64-pc"

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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