GNU bug report logs - #51462
sed bug: ASCII NUL not handled in simple pattern

Previous Next

Package: sed;

Reported by: Frances Wingerter <fw <at> immunant.com>

Date: Thu, 28 Oct 2021 16:49:02 UTC

Severity: normal

Full log


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

From: Davide Brini <dave_br <at> gmx.com>
To: bug-sed <at> gnu.org
Subject: Re: bug#51462: sed bug: ASCII NUL not handled in simple pattern
Date: Thu, 28 Oct 2021 19:32:02 +0200
On Thu, 28 Oct 2021 15:25:42 +0000, Frances Wingerter <fw <at> immunant.com>
wrote:

> I'm using sed 4.8 (`sed (GNU sed) 4.8` per `sed --version`) on x86_64
> Arch Linux.
>
> Compare the output of these two sed invocations:
> ```
> $ echo -e 'a\nb\n\0\nc\n' | sed -e '/\0/,$d'
> a
> b
>
> c
>

This works

$ echo -ne 'a\nb\n\0\nc\n' | sed -e '/\d000/,$d'

(\o000, \x00 also work). All documented here:

https://www.gnu.org/software/sed/manual/sed.html#Escapes

Whether sed maintainers want to also allow the \0 syntax, up to them of
course.

--
D.




This bug report was last modified 3 years and 228 days ago.

Previous Next


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