From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106204 invoked by alias); 27 Feb 2018 14:46:33 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 106104 invoked by uid 89); 27 Feb 2018 14:46:33 -0000 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 Received: from mail-io0-f181.google.com (HELO mail-io0-f181.google.com) (209.85.223.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Feb 2018 14:46:31 +0000 Received: by mail-io0-f181.google.com with SMTP id g21so21424904ioj.5 for ; Tue, 27 Feb 2018 06:46:31 -0800 (PST) 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) Received: from [192.168.0.19] (d4-50-42-50.try.wideopenwest.com. [50.4.50.42]) by smtp.gmail.com with ESMTPSA id c13sm1553888itd.31.2018.02.27.06.46.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 06:46:28 -0800 (PST) Subject: Re: Setting a bash variable from backtick operator fails To: cygwin@cygwin.com References: <29d3fea9-89e2-0eab-8bba-486b25fa875b@deathwyrm.com> From: cyg Simple Reply-To: cygwin@cygwin.com Message-ID: <5b929eb3-4d3d-e69d-a13e-108b63be0424@gmail.com> Date: Tue, 27 Feb 2018 14:46:00 -0000 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> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00293.txt.bz2 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