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