From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29425 invoked by alias); 12 Sep 2017 13:03:12 -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 28661 invoked by uid 89); 12 Sep 2017 13:03:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=cyg, bearing, H*R:D*cygwin.com, HContent-Transfer-Encoding:8bit X-HELO: mail-it0-f43.google.com Received: from mail-it0-f43.google.com (HELO mail-it0-f43.google.com) (209.85.214.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Sep 2017 13:03:10 +0000 Received: by mail-it0-f43.google.com with SMTP id 6so23190730itl.1 for ; Tue, 12 Sep 2017 06:03:10 -0700 (PDT) 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=wQ5DEBUjWG1HxGjlOyWUoAKfs0EnyQ+snlJYO7XZxz0=; b=My3daUUBh6xBubUTFzQu4BieTOFMcbLU7NtnkXSeJRuDxJptxbIQ1yFgq+tL945aUv rRZPs/vJLbPwrpDBh30Wb2QVabLICX2mjofagvBXsq3a7vlhpeK+BO3nQWHCc0TWPrA2 EqyH01QgNHWuvOo8Bco9Jd+UxAUfBYEyOLszBdJyoxCM7yuG6+0MS8jUuwD7/sNwkUz0 +HX2OgqD1IAasZLVjkg6oZOGbIPPfydF9UDc9ZjqgE7Trw4PgF8ajPsyZ4ZipSsPWSK6 GgcBxYuiegGNUc9ScPmq2PvTR2wWoCDxcmPegOLsOQHfOiiZqm2iV8Z11w+dV5+Z0FjX Jy8A== X-Gm-Message-State: AHPjjUjhwXo5TNGuY35p/XNLlc0GlqZFIJwKGydwFZm2smkEpHS50aMs RIyIZ1mb/KU0BL6x X-Google-Smtp-Source: AOwi7QC5UZcWnVLYSZpMmFBkwSvE8lDrONm1sfhUJjyemcnPVa5PHjlkNVjnulEwVhzGsWYjJR+vhw== X-Received: by 10.36.253.7 with SMTP id m7mr1093341ith.12.1505221388842; Tue, 12 Sep 2017 06:03:08 -0700 (PDT) Received: from [192.168.0.6] (d4-50-42-50.try.wideopenwest.com. [50.4.50.42]) by smtp.gmail.com with ESMTPSA id i15sm3529822iod.18.2017.09.12.06.03.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 06:03:08 -0700 (PDT) Subject: Re: Extra CR symbol from backticks on Cygwin 2.9.0 To: cygwin@cygwin.com References: <7ed18312-4929-8299-d186-9cb0aa541a93@redhat.com> From: cyg Simple Reply-To: cygwin@cygwin.com Message-ID: Date: Tue, 12 Sep 2017 13:03:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00135.txt.bz2 On 9/12/2017 1:38 AM, Nikolay Melekhin wrote: > Hi Eric, > > Thanks! This option is what I am looking for. > However I cannot agree with you on bash behavior in Cygwin. Section of > command substitution in bash documentation says: > > https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution > > "...with any trailing newlines deleted." That is why I expected that In POSIX and newline is simply a LF. The fact that your input from a Windows cmd.exe contains CR has no bearing on POSIX. > bash should remove trailing newlines in command substitution results, > which are CRLF on Windows. If bash were to follow Windows semantics instead of POSIX then your point would be valid. However Cygwin is a POSIX emulation so your point in this case is false. > From my point of view, bash in Cygwin should follow the same rule on > Linux and Windows: remove trailing newlines in command substitution. > So remove trailing CRLF on Windows. Since Linux and Cygwin are both POSIX then Cygwin is doing what Linux does. You just need to adjust the differences by properly filtering your input. -- 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