On 6/18/17 6:59 PM, L A Walsh wrote:
>
>
> Chet Ramey wrote:
>> Bash has always stripped NULL bytes. Now it tells you it's doing it.
> Why? Did I toggle a flag asking for the warning? Seems like it
> was sorta sprung on users w/no way to disable it.
Users asked why bash transformed input without warning, even though it
had been doing that it's entire lifetime. A warning is appropriate.
>>
>>> Side question: Why display that message if there are only
>>> NUL's at the end? I would think it normal for bash to
>>> use and read NUL terminated strings.
>>
>> This is very uncommon. Most Unix utilities use newline-terminated
>> lines.
>>
> ----
> But things are changing -- people have asked for zero-terminated read's
> and readarrays. More unix utils are offering NUL termination as an option
> because newlines alone don't cut it in some instances.
And bash provides mechanisms to deal with the relatively few use cases
where it is a problem.
Recall that the only thing that has changed is that bash now provides a
warning about what it's doing.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/