From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84584 invoked by alias); 24 Mar 2015 08:55:35 -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 84571 invoked by uid 89); 24 Mar 2015 08:55:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=AWL,BAYES_40 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Mar 2015 08:55:33 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 67594A80856; Tue, 24 Mar 2015 09:55:31 +0100 (CET) Date: Tue, 24 Mar 2015 09:04:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Altered behaviour of grep Message-ID: <20150324085531.GA20480@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <9D9AC45310887B40A7245734E850FBE1125C0E20@FS-MX02.frontier.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <9D9AC45310887B40A7245734E850FBE1125C0E20@FS-MX02.frontier.local> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-03/txt/msg00408.txt.bz2 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1164 On Mar 24 08:07, Fergus Daly wrote: > grep -Pl "\xmn" > used to find files containing the ASCII character mn. For instance > grep -PL "\x0d" or "\x0a" or usefully "\x00". > This seems to have been lost with the current version. > Is this an error? If not, can anybody tell me what new syntax will recove= r the old behaviour? I just tested this on Cygwin and Fedora 21, both with grep 2.21: $ cat x.sh #!/bin/sh echo ${0##*/} $ grep -Pl '\x30' x.sh x.sh $ grep -Pl '\x0a' x.sh $=20 Same result on both systems, so it finds characters in lines, but not the line separator itself. If that worked before, this looks like an upstream change to me. A bit of digging shows this thread on the bug-grep mailing list: http://lists.gnu.org/archive/html/bug-grep/2015-03/msg00015.html And indeed, if I add a NUL byte to the file and search for it: $ grep -Pl '\x0' x.sh $ grep -aPl '\x0' x.sh x.sh This does not work for the CR or LF, though. You may want to discuss this on the bug-grep ML. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVESaDAAoJEPU2Bp2uRE+gYjYP/0xbV5Pj6RbbI0x+Stjyr3Oh F7gVjL7nl0v4hJveRJl51jiWYj/TE91ZPh3c74BBLEY/VFrBTCtWXBMPO+4Px0vR 9lqsTnMldwLwBh7kvm42LhMCUlSU3PJw3Zk4tL2cIktgHO2nd2b4GkGTPMHfhFLE mr1dbIK7sLSCg9Ugo/mbmBbquq7Wkj9pn7hM6rxI1dNaum517awg/h41QwWukRg1 zuhPIswGvWxgh9S06ZC8w6b0PR07bNJ0sk6w0oj8SChxWOGTItK+0scfqoyecE4o lCscKRhMhfaWZ4uSImWOa2YPJFHLOdtgjonv+B4e7J19mKNaf/su6bHm9UtqeKZz ir5MFVJMyV5oteqQD0ZPQjHd8ckv8cfxWRHid0+mGNLMPsidouGz7ROky62pPD2J adivep37AlYDmrQufLO8vmZZiEQi9vjHpKUyCXknam38xtS+0VAQhMHV9h895OHE 5aIe320ViHrt6dpuKPKe5h7NUdEdYH5tKr5fdvjshlBzxm6OR3IJdXstvVMrJLUO 2nXTG4uc2Dumv3PpTVw7HSWZnbJpV0n9iWXW7GcMqjy9WCP+Jca9FwiTVrU9E0hA Uw1X9c2c/hNNXDG52MokrKuImqJiCQhZtbRi8H0745RJzxzvRmW2Dxag5Sl+x3Bv Ei74y5XFX8ErhHg90D/s =3/gj -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--