GNU bug report logs - #20638
BUG: standard & extended RE's don't find NUL's :-(

Previous Next

Package: grep;

Reported by: "L. A. Walsh" <gnu <at> tlinx.org>

Date: Sun, 24 May 2015 00:06:02 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 20638 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: "L. A. Walsh" <gnu <at> tlinx.org>, 20638 <at> debbugs.gnu.org
Subject: Re: bug#20638: BUG: standard & extended RE's don't find NUL's :-(
Date: Sun, 24 May 2015 06:58:51 -0600
[Message part 1 (text/plain, inline)]
On 05/23/2015 06:04 PM, L. A. Walsh wrote:
> the standard & extended RE's don't find find NUL's:

Because NULs imply binary data, and grepping binary data has unspecified
results per POSIX.  What's more, the NEWS for 2.21 documents that grep
is now taking the liberty of treating NUL as a line terminator when -a
is not in effect, thanks to the behavior being otherwise unspecified by
POSIX.

Try using 'grep -a' to force grep to treat the file as non-binary, in
spite of the NULs.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 9 years and 363 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.