From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122873 invoked by alias); 27 Feb 2018 15:39:44 -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 122851 invoked by uid 89); 27 Feb 2018 15:39:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:10.223.152.73, HX-Received:sk:v67mr12, H*u:6.1, H*UA:6.1 X-HELO: mail-wr0-f172.google.com Received: from mail-wr0-f172.google.com (HELO mail-wr0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Feb 2018 15:39:42 +0000 Received: by mail-wr0-f172.google.com with SMTP id k9so25346206wre.9 for ; Tue, 27 Feb 2018 07:39:42 -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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=FnTLV+FcMYtww1XXY1m7AeZyt4jDvKE7MswvQkAtlhE=; b=P2yZww1hnE5aXHyJEygOgArgd+/ImpC/+lyPaZjBd+DCVq48F8/qa/R+KQbPzthvb8 gGAti0SqMI8xstDvs+5Ww3yNlBkexmyWfQyiNFGDzyXZs0hK/MiunCWVqbDYscDHRoZh 3v0I8qI1I4GpUDM3cenp2fZRN9/iMA7O/d+E5H1iOosgFetYvt+rlZJEKdMcOU6njkDm zpQ0ceGGWjbHrscUe4CVyWXd/zYkwHR3yiR12ZOoLVYdC/pqqcwlb8fSVm/HHY2MmJv1 8hwH9RHwcuM3SdljyFbAEndHLM698Frbg9WZGF0f2x/DRGGKQ96S7XR0fcftld3hOvaw fdJw== X-Gm-Message-State: APf1xPBdF/oYhxf3z1Wesbzx80AVCpVKmO+NVeblaUsZVMTdifhvwEbs hLXBXVj0qm1KpSilMW5+P0akzQ== X-Google-Smtp-Source: AH8x226Fv6HRRSui7EH7//870SgLjFku+7vfPej4vNltPCHhtrROYUyru9WonKjSe2aTeEcVt9vqmg== X-Received: by 10.223.152.73 with SMTP id v67mr12800332wrb.19.1519745980548; Tue, 27 Feb 2018 07:39:40 -0800 (PST) Received: from ?IPv6:2003:cc:9bc0:5601:d89e:23b4:bf79:bc86? (p200300CC9BC05601D89E23B4BF79BC86.dip0.t-ipconnect.de. [2003:cc:9bc0:5601:d89e:23b4:bf79:bc86]) by smtp.googlemail.com with ESMTPSA id v63sm37138075wrc.69.2018.02.27.07.39.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 07:39:39 -0800 (PST) Subject: Re: Setting a bash variable from backtick operator fails To: cygwin@cygwin.com References: <29d3fea9-89e2-0eab-8bba-486b25fa875b@deathwyrm.com> <574336209.20180227174741@yandex.ru> From: Marco Atzeri Message-ID: <620c0401-4e1d-6008-0a54-ae4fa38388c7@gmail.com> Date: Tue, 27 Feb 2018 15:39:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <574336209.20180227174741@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00296.txt.bz2 On 27/02/2018 15:47, Andrey Repin wrote: > 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. it works also for me >> 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? likely. Someone just had similar problem with sed invocation https://stackoverflow.com/questions/48927435/cygwin-command-substitution-not-working -- 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