Subject: Re: bug#8103: NUL terminated lines

From: Jim Meyering <[email-masked]>
Date: Fri, 25 Feb 2011 21:09:17 +0100

Andreas Schwab wrote:
> Jim Meyering <[email-masked]> writes:
>
>> Bjartur Thorlacius wrote:
>>> On 2/24/11, Jim Meyering <[email-masked]> 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.