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:reply-to:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=OmV4cBavvyBSdJSP zjoiDUdiFimeC3zt8G3PixtoNOR12gssLKIGFp4VwdKsBGxDfImGSTDXfR9NXL+/ O0lh8pdqrjB+InzJ02/WqfRpnj6XZVEbbACn7lyAA1zm40NNHMY/DfMINRBuNw/j R8UPoocz2RHq5l5GWiNDQlr5kv4= 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:reply-to:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=0m7cBwd3G8ShzzzESkOFFt kkjGo=; b=qVPXi2ZMvGbpF0VQLIGxGAIpJP0Td+Tw/BMh5Ixptd9j73VOJQgYoj 1ad/a8fTEJAJ/6G7Aq0+jiKRm0Oum26TGKh9imJPaq/IDN2RYJHW+MTfmr9SoEXq egepEx8CVo4bCgftVL6J+3vKV1vHAHL7vrzdNT+At0+NXHYw6OuQQ= 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.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 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) Subject: Re: Extra CR symbol from backticks on Cygwin 2.9.0 To: cygwin AT cygwin DOT com References: <7ed18312-4929-8299-d186-9cb0aa541a93 AT redhat DOT com> From: cyg Simple Reply-To: cygwin AT cygwin DOT com Message-ID: Date: Tue, 12 Sep 2017 09:03:09 -0400 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 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