From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 25 11:27:09 2018 Received: (at submit) by debbugs.gnu.org; 25 Jan 2018 16:27:09 +0000 Received: from localhost ([127.0.0.1]:42742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eekMm-0003bL-Gt for submit@debbugs.gnu.org; Thu, 25 Jan 2018 11:27:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eehXR-0007cp-7p for submit@debbugs.gnu.org; Thu, 25 Jan 2018 08:25:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eehXK-0003w2-VO for submit@debbugs.gnu.org; Thu, 25 Jan 2018 08:25:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:32811) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eehXK-0003vu-QY for submit@debbugs.gnu.org; Thu, 25 Jan 2018 08:25:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eehXJ-0006Jl-8L for bug-sed@gnu.org; Thu, 25 Jan 2018 08:25:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eehXI-0003rm-B8 for bug-sed@gnu.org; Thu, 25 Jan 2018 08:25:49 -0500 Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]:40227) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eehXI-0003qG-3I for bug-sed@gnu.org; Thu, 25 Jan 2018 08:25:48 -0500 Received: by mail-it0-x236.google.com with SMTP id 196so9317439iti.5 for ; Thu, 25 Jan 2018 05:25:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=MieJFmc5hPTyVm4InYER+1iqm7aGDPRyylsAc7Dvlew=; b=IDhneAiZQFEx5uRbIfc+MhEXTdjGseVpUY3bodm/M22Zqoddx7ZW8kSvq/nsXf2xhc kdPipyoOB+jRN/9fjX68tPpqdKbMTvT/zds6o0W8CU730t0YWgcxKrFB5547/+UkgjIk UD1ihX2lL/WaSk5Jfan8nAC5lbxdej6Vh8i2gD4Bf0Zu/QGdaN2yjJgsj2XvwTmizJPE PDWeAojSldkttQCfOK/LE9tEpFuFUfhlaMa/d/uMRbojN+HUD+p7nTg+hnhChTPJhSeU 1MIamqtDhCoT9bXKmNQI3SJbkxGWfA97raiEV9RidKSK6TR/bpvgDGewGc8K/hOHToyI UHUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=MieJFmc5hPTyVm4InYER+1iqm7aGDPRyylsAc7Dvlew=; b=Lu32V266FvRyZQretfBVBZkUDwfqDShk+DtJPXOmuFLbGi820Zcno6bRrBG94JhbIZ oy5bvzPX7OEt6T2Vtp0cKWLPVp347djATcs7lozsOroi/gKzrzJRNo5PM5xdoPunLEg0 wjCLXJL1R+8s0fkXFlxeTeJ1XeirxtuWIzKvPx1s4MF/9NSMdF+NPJ9ZYLODc19IYtpC jPqAqVbzKxZtV46hbZT9ECb2FrpO1Orh3ALBQBPgI9I/ZFm3rLpzF1JP4gQ45BEddSSj FmiXDoiguHtOPzbN1bdjfC4zeuPUHf2i2DM63WgOt0eHw9Bi2u03Gl2iS5XnRIS5Tekf Y5tw== X-Gm-Message-State: AKwxytf8+rjTAQSRrWOemx8074QqJ495RMHu5CQttmcbVBlVGiLJX43Y FuCmtLgKfsHvfXCy4QZkIGQ6EOp2DXSvuMb2lxwKHg== X-Google-Smtp-Source: AH8x225cX56vcAjjRnGhV+40JqpizQrZQNkEO7586h0Ima0iSFXp97OKCp9W4aTXztgedkRlSb+QYj7rhjiH17XPsuI= X-Received: by 10.36.43.129 with SMTP id h123mr13658860ita.33.1516886746868; Thu, 25 Jan 2018 05:25:46 -0800 (PST) MIME-Version: 1.0 From: Mauro Rigoni Date: Thu, 25 Jan 2018 13:25:35 +0000 Message-ID: Subject: REMOVE bllank line on DOS file format To: bug-sed@gnu.org Content-Type: multipart/mixed; boundary="001a1146ef7cb66f49056399b7df" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 25 Jan 2018 11:27:07 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a1146ef7cb66f49056399b7df Content-Type: multipart/alternative; boundary="001a1146ef7cb66f46056399b7dd" --001a1146ef7cb66f46056399b7dd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, with the last x86_32 version of sed (windows platform) the following pattern sed '\?^$?D' don=E2=80=99t remove blank line from file if the file is in DOS format. In = the previous version 2.2 this command working. In attach the demo test files. *sed --version :* *sed (GNU sed) 4.4* *Packaged by Cygwin (4.4-1)* *Copyright (C) 2017 Free Software Foundation, Inc.* *License GPLv3+: GNU GPL version 3 or later >.* *This is free software: you are free to change and redistribute it.* *There is NO WARRANTY, to the extent permitted by law.* *Written by Jay Fenlason, Tom Lord, Ken Pizzini,* *and Paolo Bonzini.* *GNU sed home page: >.* *General help using GNU software: >.* *E-mail bug reports to: >.* --=20 Saluti Mauro Rigoni --001a1146ef7cb66f46056399b7dd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi,

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 with the last = x86_32 version of sed (windows platform) the following pattern

=C2=A0

sed '\?^$?D'

=C2=A0

don=E2=80=99t remove blank line from file if the file is in DOS format. In the previous version 2.2 this command working.


In = attach the demo test files.


sed --= version :

= sed (GNU sed) 4.4

Packaged by Cygwin (4.4-1)

Copyright (C) 2017 Free Software Foundation, Inc.<= /i>

License GP= Lv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free = to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.<= /i>


Written by Jay = Fenlason, Tom Lord, Ken Pizzini,

and Paolo Bonzini.

GNU sed home page: <http://www.gnu.org/software/sed/>.

General help using= GNU software: <http://www.gnu.o= rg/gethelp/>.

E-mail bug reports to: <bug-sed@gnu.org>.

--

Saluti
Mauro Rigoni

--001a1146ef7cb66f46056399b7dd-- --001a1146ef7cb66f49056399b7df Content-Type: text/plain; charset="US-ASCII"; name="test_DOS.txt" Content-Disposition: attachment; filename="test_DOS.txt" Content-Transfer-Encoding: base64 Content-ID: <1612d78d3654be819fd2> X-Attachment-Id: 1612d78d3654be819fd2 DQoxICAgICANCjINCg0KMw0K --001a1146ef7cb66f49056399b7df Content-Type: text/plain; charset="US-ASCII"; name="test_UNIX.txt" Content-Disposition: attachment; filename="test_UNIX.txt" Content-Transfer-Encoding: base64 Content-ID: <1612d78d340d3486a171> X-Attachment-Id: 1612d78d340d3486a171 CjEKMgoKMwo= --001a1146ef7cb66f49056399b7df-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 25 16:59:31 2018 Received: (at 30251) by debbugs.gnu.org; 25 Jan 2018 21:59:31 +0000 Received: from localhost ([127.0.0.1]:42916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eepYQ-0002rl-PJ for submit@debbugs.gnu.org; Thu, 25 Jan 2018 16:59:30 -0500 Received: from mail-oi0-f46.google.com ([209.85.218.46]:43985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eepYQ-0002rZ-65 for 30251@debbugs.gnu.org; Thu, 25 Jan 2018 16:59:30 -0500 Received: by mail-oi0-f46.google.com with SMTP id 4so2933035ois.10 for <30251@debbugs.gnu.org>; Thu, 25 Jan 2018 13:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=J+oucEXD+fS82njydYiCByLydRXFOERBXcKruYVvul8=; b=Wx9dpSD3TIAnHR74GImOf+y+IGmxr3bGRFYzZnV/pwyc2mc4CLEqhD9syrtnbtx5HK Zqr0gRM9Bf1H/hWv6wGo1wfN2+v/px+POhlLYEH6DtR1CnnuHNkiBjNP4BenfXfiTppG w9FeWUuV8b+nOdG283s0DCRCv0vyzO01BFzncTj9rfARrCTRBo1xebD2rWWDLkdKSgJd jW2AC69qtG2fI5hhmeMc9DvlBpPYf6I50Viu5R+6hrJf6yLFvNFosV9wd1qKf/3+ZotM +iBOZt058PWIdM3LhLdT19pWrNnttj5E5Dc5dbStpsH3btGs3Ubb7dxlAGHkY8sVZX6r 7GbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=J+oucEXD+fS82njydYiCByLydRXFOERBXcKruYVvul8=; b=odlZ9H0a9cD5O/CmwV2CXo7tDK8ZdFE4zfHRGP9n24ir04gzvTrAwwdlkWgNONxpH6 v2Vb3yf2itH41bkQ9xeHPIYgkaQNAR89jOlKB3TVE4Gey6nmxSDlV5OWgWSZu4PyOlW9 b+p2GtRT7EX3VCf+Q23/RjYBMtzEDbzwJpVZepqk/OIn30JJ11ROwMrEVmGkyxDRAXwu ruL89zyrKczacC+UxhnxS2nVADX7UTVnRe1CIbP1iTjr7aKiuD7kbCq7mOMiUZd0II2p AnXJpM+M+Le1eW1n8H3lfN58i4b/f1hANqD8IjAzD1C4z9rtZA5M0qD9u82NBbRs3fzR GffA== X-Gm-Message-State: AKwxyteQ/ScTwzOmx5km+Fr7eE9INEs2lakMaanvukeTKJXW1lJFe4/x bbAtm3UbDqZMk6muWcG3qmg= X-Google-Smtp-Source: AH8x227n2pSaUl/1SP1Lis8IOfsrURnCfTT7HWGVTUotK1EJmVqstcXpx2vzeERnvTFwqiQCr0O+yw== X-Received: by 10.202.77.148 with SMTP id a142mr12420075oib.300.1516917564479; Thu, 25 Jan 2018 13:59:24 -0800 (PST) Received: from radish.uptown.housegordon.org (moose.housegordon.com. [184.68.105.38]) by smtp.gmail.com with ESMTPSA id e7sm3705654oic.50.2018.01.25.13.59.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jan 2018 13:59:23 -0800 (PST) Date: Thu, 25 Jan 2018 14:59:21 -0700 From: Assaf Gordon To: Mauro Rigoni Subject: Re: bug#30251: REMOVE bllank line on DOS file format Message-ID: <20180125215921.xz2obuj3m5awnkos@radish.uptown.housegordon.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30251 Cc: 30251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello, On Thu, Jan 25, 2018 at 01:25:35PM +0000, Mauro Rigoni wrote: > with the last x86_32 version of sed (windows platform) the > following pattern > > sed '\?^$?D' > > don’t remove blank line from file if the file is in DOS format. In the > previous version 2.2 this command working. First, Sed version 2.X is more than 20 years old. It is not the previous version. The previous (and most common) version is version 4.2.2 from 2012. Can you test your sed program with version 4.2.2 ? Second, A question about your sed program: Does the problem still happen if you use the following? sed '/^$/d' That is, regex with slashes (instead of '\?') and using lower-case 'd' (simple delete command) instead of 'D' (which is slightly more complicated and deals with multilined buffers). Third, I do not have access to a windows machine, so a bit more information is needed: 1. Which windows version are you using? 2. Which cygwin version are you using? (I assume it is cygwin based on the version string) 3. Can you try the same sed command, but add the '--binary' flag, if does it show the same results? For reference, there is are two bug reports related to newlines with sed on windows. https://bugs.gnu.org/25459 and https://bugs.gnu.org/26879 . Specifically, note here https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26879#12 where Eric Blake mentions that cygwin modified some internal behaviour related to binary-vs-text files in February 2017. regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 25 17:13:14 2018 Received: (at 30251) by debbugs.gnu.org; 25 Jan 2018 22:13:14 +0000 Received: from localhost ([127.0.0.1]:42920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eepli-0003F3-0X for submit@debbugs.gnu.org; Thu, 25 Jan 2018 17:13:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeplg-0003Eq-NK for 30251@debbugs.gnu.org; Thu, 25 Jan 2018 17:13:13 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 541C9DB932; Thu, 25 Jan 2018 22:13:06 +0000 (UTC) Received: from [10.10.124.3] (ovpn-124-3.rdu2.redhat.com [10.10.124.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3580605DC; Thu, 25 Jan 2018 22:13:05 +0000 (UTC) Subject: Re: bug#30251: REMOVE bllank line on DOS file format To: Mauro Rigoni , 30251@debbugs.gnu.org References: From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <644dcb49-8235-f88d-4365-a9e0917bf956@redhat.com> Date: Thu, 25 Jan 2018 16:13:04 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bRp7pf5EUmgJ4mawAetpKjWD5JnjposdF" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 25 Jan 2018 22:13:06 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30251 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bRp7pf5EUmgJ4mawAetpKjWD5JnjposdF Content-Type: multipart/mixed; boundary="ufFDgxzVNHvXQVWWF9LT3ZbPumTbTjqGl"; protected-headers="v1" From: Eric Blake To: Mauro Rigoni , 30251@debbugs.gnu.org Message-ID: <644dcb49-8235-f88d-4365-a9e0917bf956@redhat.com> Subject: Re: bug#30251: REMOVE bllank line on DOS file format References: In-Reply-To: --ufFDgxzVNHvXQVWWF9LT3ZbPumTbTjqGl Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 01/25/2018 07:25 AM, Mauro Rigoni wrote: > *sed (GNU sed) 4.4* >=20 > *Packaged by Cygwin (4.4-1)* Questions about the Cygwin port of sed are best directed to the Cygwin list. In particular, note that the Cygwin folks have decided that it is better to have sed operate in binary mode by default (it used to operate in text mode and silently corrupt binary data); so you HAVE to strip out line endings yourself as a pre-processing step before handing the data to sed (the same as you would have to do when processing DOS files on Linux, where text and binary files have synonymous behaviors). More information here: https://cygwin.com/ml/cygwin-announce/2017-02/msg00036.html --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --ufFDgxzVNHvXQVWWF9LT3ZbPumTbTjqGl-- --bRp7pf5EUmgJ4mawAetpKjWD5JnjposdF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlpqVnAACgkQp6FrSiUn Q2q+nQf/XzO+EfN+ieF/mDBsEK+IqfRMGgEdCluRujMyieUGWNhTWj/nZ5lZB9w1 Vu1u1+QWFTBm0JPbP1mrz9kjo5cJbl2G5CTo8bJOWgidIU82toII6nfkwTrMLUUH IukcBn7xSjF+QutUs5CMR+fPi0EM2GDFswDoIqPyuw9x9OxPqe08mCRlTF3O0M0d CCNT6w96NCr2u3uFpAIggZ294BRs3aNTy0xLGUlptrWKOtO/on6HL6PYs+S3rc8B HOmL47EShfzD4sPMWkZhczR7bWILuqHNbQQTWP4KfTGtm4Vpgo+T/WiyNhKA5ZSj SpyKhACuYT5S4rjzG9xJQZAB4rTT9w== =BE0F -----END PGP SIGNATURE----- --bRp7pf5EUmgJ4mawAetpKjWD5JnjposdF-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 26 07:33:38 2018 Received: (at 30251) by debbugs.gnu.org; 26 Jan 2018 12:33:38 +0000 Received: from localhost ([127.0.0.1]:43152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ef3CM-00026A-5m for submit@debbugs.gnu.org; Fri, 26 Jan 2018 07:33:38 -0500 Received: from mail-io0-f181.google.com ([209.85.223.181]:44356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ef3CK-00025w-SA for 30251@debbugs.gnu.org; Fri, 26 Jan 2018 07:33:37 -0500 Received: by mail-io0-f181.google.com with SMTP id z6so293340iob.11 for <30251@debbugs.gnu.org>; Fri, 26 Jan 2018 04:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j01pEPfuu0/PAb2F5PJ2pIYxVTFLdmN7FXEiC5bd78o=; b=UJNugTaXpnkrfk7J34SAkFJ8tR855Ov4zIMvFhRLzN1cCtV0A843zhYvrPZ1jyKTHC mh0Oe1BWUbLKvsEpFmXzakRfCjuawOwhEaz4KmhJfNdkb1Fpxr/t0siEASKBT7Ug5ZUU DtkLisc6n5OYWvUQvTt6IXOl/OxXOkAXmTEhEIkeNHcAT2P1n6FujHkq5TgmCsFzG13T HFz1JDxnhezEdqgck+ZXvMq0lAUdKWSKC5rjtMI1JNzXAFCX2ZzCkrVs8FRulJJFd9t4 JzDAE23piVgz1nq46GqDzAZk3aTzHWd+G7+tQWxfvzuImykZSarK3hrrbNNH18NfKTJz 0TYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j01pEPfuu0/PAb2F5PJ2pIYxVTFLdmN7FXEiC5bd78o=; b=NmKG0Ztv0/IiEzrWNXRZloXMYpXuANbkJvoGyHvt9Igjc4sLR4ReElX8clkwsc9fl2 39fB/y+UUKw7S4pZabg3AYIpAmAKu0g5x6javqaeVAlN8ii2lpZMb1KIXlwwGxE882/u 9gOCI/QIINzdAbDvSS1teLzf8lib4T+E9bjo13oLFdHWp4786/InM4YtLa5TbicNQGw3 +9rMmOJ58AeXqvOs3n++C4u5l6gqAUIYEiEFh5/5J2+pIo2rStZt6oErpHBfYRzl0BGO oAPDZntwPlDGfKPLwM1CmBhqY7FYbDpIwxTVawfLm6coZGwnherxwAHODJnoHT+Nwchc P+eQ== X-Gm-Message-State: AKwxytfY9hMLArl8nD9/vqeFByLVz4UNjIrSqQ1batVf4viuiNdianvS AusK3UU+cKTZNrx5WQC4arnkTJCyS3NAg4YrdnQ= X-Google-Smtp-Source: AH8x2279vupBkiiStswZWfMiTerZVAYS/ZLo7OpVavNaqkav8vchuA2mN52/JWo8U0qbIqkcFKJ9tqCA+UGLaOgGTr8= X-Received: by 10.107.70.25 with SMTP id t25mr15794934ioa.126.1516970011017; Fri, 26 Jan 2018 04:33:31 -0800 (PST) MIME-Version: 1.0 References: <20180125215921.xz2obuj3m5awnkos@radish.uptown.housegordon.org> In-Reply-To: <20180125215921.xz2obuj3m5awnkos@radish.uptown.housegordon.org> From: Mauro Rigoni Date: Fri, 26 Jan 2018 12:33:20 +0000 Message-ID: Subject: Re: bug#30251: REMOVE bllank line on DOS file format To: Assaf Gordon Content-Type: multipart/alternative; boundary="089e08281d60a456f40563ad1ab9" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30251 Cc: 30251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --089e08281d60a456f40563ad1ab9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, we use CYGWIN in our application, and there are a lot of shell-script that use this sintax. In Windows environment, is normat that the End-Line terminator is CRLF e not LF. Regarding your question: 1) Can you test your sed program with version 4.2.2 ? R: Yes, same problems 2) Does the problem still happen if you use the following? sed '/^$/d' R:: same problems 3.1. Which windows version are you using? Tested on Windows server 2012, Windows Server 2016, Windows 7 (all 64 bit) 3.2. Which cygwin version are you using? uname -a -> CYGWIN_NT-10.0-WOW ITP-WDK2020 2.9.0(0.318/5/3) 2017-09-12 10:41 i686 Cygwin 3. Can you try the same sed command, but add the '--binary' flag, if does it show the same results? R:: same problems Regards Mauro Il giorno gio 25 gen 2018 alle ore 22:59 Assaf Gordon ha scritto: > Hello, > > On Thu, Jan 25, 2018 at 01:25:35PM +0000, Mauro Rigoni wrote: > > with the last x86_32 version of sed (windows platform) the > > following pattern > > > > sed '\?^$?D' > > > > don=E2=80=99t remove blank line from file if the file is in DOS format.= In the > > previous version 2.2 this command working. > > First, > Sed version 2.X is more than 20 years old. It is not the previous version= . > The previous (and most common) version is version 4.2.2 from 2012. > Can you test your sed program with version 4.2.2 ? > > > Second, > A question about your sed program: > Does the problem still happen if you use the following? > sed '/^$/d' > > That is, regex with slashes (instead of '\?') > and using lower-case 'd' (simple delete command) > instead of 'D' (which is slightly more complicated > and deals with multilined buffers). > > > Third, > I do not have access to a windows machine, so a bit more information > is needed: > 1. Which windows version are you using? > 2. Which cygwin version are you using? > (I assume it is cygwin based on the version string) > 3. Can you try the same sed command, but add the '--binary' flag, > if does it show the same results? > > For reference, > there is are two bug reports related to newlines with sed on windows. > https://bugs.gnu.org/25459 and https://bugs.gnu.org/26879 . > > Specifically, note here > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D26879#12 > where Eric Blake mentions that cygwin modified some internal > behaviour related to binary-vs-text files in February 2017. > > > regards, > - assaf > --=20 Saluti Mauro Rigoni --089e08281d60a456f40563ad1ab9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,
=C2=A0 we use CYGWIN in our application, and th= ere are a lot of shell-script that use this sintax. In Windows environment,= is normat that the End-Line terminator is CRLF e not LF.

Regarding your question:

1) Can you test y= our sed program with version 4.2.2 ?=C2=A0=C2=A0
=C2=A0 =C2=A0 R:= Yes, same problems=C2=A0

2) Does the problem stil= l happen if you use the following?=C2=A0 =C2=A0sed '/^$/d'=C2=A0 = =C2=A0
=C2=A0 =C2=A0 R:: same problems

3= .1. Which windows version are you using?
=C2=A0 = =C2=A0 =C2=A0 =C2=A0Tested on Windows server 2012, Windows Server 2016, Win= dows 7 (all 64 bit)

3.2. Which cygwin version are you u= sing?
=C2=A0 =C2=A0 =C2=A0 =C2=A0uname -a ->=C2=A0= CYGWIN_NT-10.0-WOW ITP-WDK2020 2.9.0(0.318/5/3) 2017-09-12 10:41 i686 Cygw= in

3. Can you try the same sed command, but add the '--binary= 9; flag,=C2=A0 =C2=A0if does it show the same results?
=C2=A0 =C2= =A0 =C2=A0R:: same problems


Regards

Mauro

Il giorno gio 25 gen 2018 alle ore 22= :59 Assaf Gordon <assafgordon@gmail.com> ha scritto:
Hello,

On Thu, Jan 25, 2018 at 01:25:35PM +0000, Mauro Rigoni wrote:
> with the last x86_32 version of sed (windows platform) the
> following pattern
>
> sed '\?^$?D'
>
> don=E2=80=99t remove blank line from file if the file is in DOS format= . In the
> previous version 2.2 this command working.

First,
Sed version 2.X is more than 20 years old. It is not the previous version.<= br> The previous (and most common) version is version 4.2.2 from 2012.
Can you test your sed program with version 4.2.2 ?


Second,
A question about your sed program:
Does the problem still happen if you use the following?
=C2=A0 =C2=A0sed '/^$/d'

That is, regex with slashes (instead of '\?')
and using lower-case 'd' (simple delete command)
instead of 'D' (which is slightly more complicated
and deals with multilined buffers).


Third,
I do not have access to a windows machine, so a bit more information
is needed:
1. Which windows version are you using?
2. Which cygwin version are you using?
(I assume it is cygwin based on the version string)
3. Can you try the same sed command, but add the '--binary' flag, =C2=A0 =C2=A0if does it show the same results?

For reference,
there is are two bug reports related to newlines with sed on windows.
https://bugs.gnu.org/25459 and https://bugs.gnu.org/26879 .

Specifically, note here https://debbugs.gnu.= org/cgi/bugreport.cgi?bug=3D26879#12
where Eric Blake mentions that cygwin modified some internal
behaviour related to binary-vs-text files in February 2017.


regards,
=C2=A0- assaf
--

Saluti
Mauro Rigoni

--089e08281d60a456f40563ad1ab9-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 28 00:42:47 2018 Received: (at 30251) by debbugs.gnu.org; 28 Jan 2018 05:42:47 +0000 Received: from localhost ([127.0.0.1]:45666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1effjr-0007Sk-9p for submit@debbugs.gnu.org; Sun, 28 Jan 2018 00:42:47 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:46575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1effjo-0007SS-Rd; Sun, 28 Jan 2018 00:42:45 -0500 Received: by mail-pf0-f170.google.com with SMTP id y5so2308257pff.13; Sat, 27 Jan 2018 21:42:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=J2p79irQ5Y0xgJp2pRUxoXI9vybttLq0R7sylZEz7+Q=; b=TtI3R8yLJl0gjgPSL2j/Q6rlXqXHQoZ3Nm93RcfDByqF3QIuPhBEN4zwjFpbvoLqwn sxDjMqkcHEupP5OqZFdItDfTe0RzYagXmsK6gtaCiJyOgGfGr6wNpalUNCoZmsYE1KjG VHOyNwJiFHyd/RLRNMPh3PQIjKfiQRuj5BreWr+plMSPGLm+KQmBj1M8uoXodliEREq4 TPZVczkRF5kx3SiVRzKEo+kdZo1GjxCo2WCjkIGEXIkheqDOeUrktfa4y4RZ8XWxdKRl zQeCq8NXU5VX4Ou5K3B5mdOF9UszeGyZFC6WoglaAQSySEVmZ/N86gcrvG40zU8nsMAg NRZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=J2p79irQ5Y0xgJp2pRUxoXI9vybttLq0R7sylZEz7+Q=; b=DRM3ECD2dMyBi1UzNY3y/0TGbFmzr68ksv+DKFysuhFjKE6trbgnqBr0lsY8xDaIRY ffr3IFGwUS++26XGKbPLSRQflRYqd+DVFuHf/GhzBNg7kauMsgFNXOvGluj5IM/7nzyD HjNxnBFsI9Uo72W9k3E7uIubI9OM+u0gy6eUpqFwnoPRnuRuKGAfAt67EYPrOa+xrHvP 3U0N0bunz5xleldAitBOWkOzQVyUo0R20KlFZTzeTsCFrBRQ0VqgEQuVui9/hvh7S+ax mXt2GRzyhPx2AcCT1e+e2i6QwgVelkaMYypvqd8zxy4O8L/CyRazc7Jz2vJrftJGfv7Y LsCA== X-Gm-Message-State: AKwxyteXlhw9FqRKwiOxIQBNyGmZEXztzwnfJIjgbFr8hGxTMgTaGbRH rjJJfP4RhPE3QYrnsUlMhXyT10/3 X-Google-Smtp-Source: AH8x225ponj/hyApbVgUGPHUKRYgfaF+gGYOOyAVNSsbknb5cycBuK2JLGxrm3bRMglKRWxKlvjD+g== X-Received: by 10.101.73.203 with SMTP id t11mr19313572pgs.48.1517118158610; Sat, 27 Jan 2018 21:42:38 -0800 (PST) Received: from [192.168.88.239] (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id t1sm29522901pfj.21.2018.01.27.21.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Jan 2018 21:42:37 -0800 (PST) Subject: Re: bug#30251: REMOVE bllank line on DOS file format To: Mauro Rigoni References: <20180125215921.xz2obuj3m5awnkos@radish.uptown.housegordon.org> From: Assaf Gordon Message-ID: <963f36f2-193f-3a94-075a-8c6f78a6d484@gmail.com> Date: Sat, 27 Jan 2018 22:42:36 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30251 Cc: 30251@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tag 30251 notabug close 30251 stop Hello, On 2018-01-26 05:33 AM, Mauro Rigoni wrote: >   we use CYGWIN in our application, and there are a lot of shell-script > that use this sintax. In Windows environment, is normat that the > End-Line terminator is CRLF e not LF. In Windows, yes. But as the previous emails in this thread mentioned, not in unix, and Cygwin recently changed its behavior to match unix more closely. > Regarding your question: > > 1) Can you test your sed program with version 4.2.2 ? >     R: Yes, same problems > [...] > 3.2. Which cygwin version are you using? >        uname -a ->  CYGWIN_NT-10.0-WOW ITP-WDK2020 2.9.0(0.318/5/3) > 2017-09-12 10:41 i686 Cygwin Based on this information, it is likely that the change in behavior you are experiencing is due to a recent Cygwin version (or the way Cygwin developers build 'sed') and not due to a bug in sed itself. Cygwin version 2.9.0 was released in September 2017, and it already included the change in CR/LF handling. You can try several things: 1. Build sed from sources, and enable the 'binary' handling by default (the same option that is now disabled by default on cygwin). 2. Try to downgrade to an older cygwin version (likely time-consuming, and not recommended). 3. Accept the new behavior, and add an additional step of removing the CR characters using 'd2u' as suggested by Eric Blake. As such, I'm marking this as not-a-bug and closing the ticket, but discussion can continue by replying to this thread. regards, - assaf From unknown Sun Aug 17 22:03:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 25 Feb 2018 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator