GNU bug report logs - #8103
tac RFE: accept -z, --zero-terminated option

Previous Next

Package: coreutils;

Reported by: Bjartur Thorlacius <svartman95 <at> gmail.com>

Date: Wed, 23 Feb 2011 23:26:02 UTC

Severity: wishlist

Tags: easy, notabug

Full log


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

From: Jim Meyering <jim <at> meyering.net>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Bjartur Thorlacius <svartman95 <at> gmail.com>, 8103 <at> debbugs.gnu.org
Subject: Re: bug#8103: NUL terminated lines
Date: Fri, 25 Feb 2011 21:09:17 +0100
Andreas Schwab wrote:
> Jim Meyering <jim <at> meyering.net> writes:
>
>> Bjartur Thorlacius wrote:
>>> On 2/24/11, Jim Meyering <jim <at> meyering.net> wrote:
>>>> With GNU tac, that has never worked:
>>>>
>>>>     $ tac -s ''
>>>>     tac: separator cannot be empty
>>>>
>>> NUL!=the empty string.
>>
>> tac treats them the same way.
>
> Actually the shell does.  $'\0' and '' are indistinguishable once passed
> as argument.

I thought so, too.  Then I tried this:

    $ zsh  -c "printf \$'\0'|wc -c"
    1
    $ bash -c "printf \$'\0'|wc -c"
    0

The former prints a NUL byte.
The latter prints nothing.

So it depends on your shell.




This bug report was last modified 6 years and 252 days ago.

Previous Next


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