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:from:to:subject:date:message-id:content-type :mime-version:content-transfer-encoding; q=dns; s=default; b=Ifb dJXfviVbGhgDvd4MISrVlG1P60FoknJXmQcU2/Td8q0HARet0Kcp0EbcNPyp4f9k ZQIrbeF52bGsyNaCTfWGwovs1XUCzwu2lvTkbt/A4Am+Midp7sAL7vCJOPDzJbEF fH9Z1P63NwoU9fBB1P+4DRLmh5pUrG/BMZsmR8zo= 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:from:to:subject:date:message-id:content-type :mime-version:content-transfer-encoding; s=default; bh=Hf4DqXhTL Jvi5KZGLth945cK8ls=; b=LnQ1BJ3ik5+WcQ7pEqd6+MS1gkrac96mjY9+GWSiw ga+LUJeF3Zv5Zc14+/Ix2SJlTvVgIYdYxsCytBlUaxXSMN5u6kAFOY8D2S6f+VTm 8Kjdgc3VoNLL76XlsTH0R61DA67cLcwISVUCFglgeVcjB6CRi+7Hbt7b5ZScUtgH pk= 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=0.8 required=5.0 tests=AWL,BAYES_40,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=nicole, Deutschland, Nicole, deutschland X-HELO: mga04.intel.com X-ExtLoop1: 1 From: "Soegtrop, Michael" To: "cygwin AT cygwin DOT com" Subject: CR-LF handling behavior of SED changed recently - this breaks a lot of MinGW cross build scripts Date: Wed, 7 Jun 2017 16:23:39 +0000 Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A175B2636E4@IRSMSX103.ger.corp.intel.com> dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v57GO34K016634 Dear Cygwin Team, in the latest version of cygwin with sed-4.4-1.tar.bz2 the behavior of sed regarding handling CR-LF sequences changed. The last version I tried where this was still working is sed-4.2.2-3.tar.bz2. I would say that the documented behavior in both versions is that they replace CR-LF with LF, because both version have a documented option -b to switch of this behavior. But in version 4.4-1 this doesn't work anymore. This breaks a lot of build scripts, because var=$( prog | sed .) now usually adds a carriage return to the variable in case the called prog is a MinGW program - a common scenario in MinGW cross development. Is this considered a bug in sed 4.4-1 or is the old behavior and the -b option considered deprecated and it was just forgotten to remove the documentation for the -b option? Best regards, Michael Old behavior (sed 4.2.2-3): $ echo -e "a\r\nb\r\nc\r" | sed 's/a//' | hexdump -C + echo -e 'a\r\nb\r\nc\r' + sed s/a// + hexdump -C 00000000  0a 62 0a 63 0a                                    |.b.c.| 00000005 New behavior (sed 4.4-1): $ echo -e "a\r\nb\r\nc\r" | sed 's/a//' | hexdump -C + echo -e 'a\r\nb\r\nc\r' + sed s/a// + hexdump -C 00000000  0d 0a 62 0d 0a 63 0d 0a                           |..b..c..| 00000008 Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928 -- 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