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:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=YnB3dJsCS8lbP3JC tVWKJORUOyyE/j7xr0T80OVFmZanBGlwa7JI7+jPIYKHaJnTVHt8O80rmx2aVOfM GOu6LcxPJ/EnD/GlFnBLgkgvjJlbKVpy+mU4j5gwhjt3u8rqvhe5eV4fvs5nDPfa vu7TApgV6C3crBX3pF4YACMhJVc= 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:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=OE1MUuEVc9CHEOYj3POTkW ublQU=; b=lxqEQ1TI0iED+as5aw0lBHhiYeP0zKlceZf8VqCDfjprVNOmaog16F EF5XNz7pI6DrBOFMyz+5TcDu7Wvm64aFbADa5k88mjPlxniuobRmDtrXRDjdM7Qo aTgV+NNZPpMAxoCxObgtzQCUaCfiLa9iIR18O8RIzJ7I4EFwrkA74= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=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 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) 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> <574336209 DOT 20180227174741 AT yandex DOT ru> From: Marco Atzeri Message-ID: <620c0401-4e1d-6008-0a54-ae4fa38388c7@gmail.com> Date: Tue, 27 Feb 2018 16:39:38 +0100 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 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