From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66560 invoked by alias); 15 Jun 2018 22:02:55 -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 66549 invoked by uid 89); 15 Jun 2018 22:02:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=inglis, Inglis, Brian, Hx-languages-length:945 X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Jun 2018 22:02:53 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with ESMTP id Twnxfrl1PSzNNTwnyfEOV6; Fri, 15 Jun 2018 16:02:50 -0600 X-Authority-Analysis: v=2.3 cv=KuxjJ1eN c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=4Bk-y7KSnTpDDFk79A0A:9 a=QEXdDO2ut3YA:10 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: Re: 2.10.0: Cygwin now can not work well with a file in dos format. To: cygwin@cygwin.com References: <2bfeabde.39a8.16403e31153.Coremail.tuyanyi@163.com> <0F7D3B1B3C4B894D824F5B822E3E5A177880092C@IRSMSX102.ger.corp.intel.com> From: Brian Inglis Openpgp: preference=signencrypt Message-ID: <18573474-64a0-8848-bd87-1343475730db@SystematicSw.ab.ca> Date: Sat, 16 Jun 2018 00:49:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A177880092C@IRSMSX102.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfOGErQzGur5jgpnuWtVcv1idouMBOfhyTNmntkfYaNz9mUm7hxZ2MFzuH0AWSur7045sWWlIZpUnTwa8efUD9f4Rco2YAAuiO0t7MJKl+VI+hntYcdqc GpCNzGi84MsgMg4sr7gAre2eRW6NjSHAaCyUVICZeTdINxLToaVxPpuAa7425uuKi3Ydz3nb5QCdng== X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00181.txt.bz2 On 2018-06-15 09:11, Soegtrop, Michael wrote: > what has been changed in sed and awk is handling of carriage returns. The sed > and awk of older Cygwin version strip \r from the input. Newer versions > behave like the same tools on Linux and don't strip CR. This is documented > in the release notes, intended behavior and has been discussed quite > extensively on the list (I complained about the same issue some-time last > year).> The options you have is either to strip the \r characters away first (e.g. > using tr) or to compile old versions of awk and/or sed from sources. Use sed commands: $ sed -e 's/\r$//' ... # strip input \r $ sed ... -e 's/$/\r/' ... # insert output \r or awk options: $ awk -v RS='\r?\n' # strip input \r $ awk -v ORS='\r\n' # insert output \r to work the same on any system. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- 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