On 1/18/16 11:25 AM, Greg Wooledge wrote:
> On Mon, Jan 18, 2016 at 11:16:06AM -0500, Chet Ramey wrote:
>> On 1/18/16 8:14 AM, Greg Wooledge wrote:
>>> I suspect the interpretation of -d '' to mean a NUL byte delimiter
>>> may have been an accident originally (but that's a guess).
>>
>> I guess that depends on what you mean by `accident'.
>
> Happy coincidence, then.
Sure.
>
>> It's not a special case that needs to be documented as such. It's a
>> straightforward application of the rules for assigning the delimiter
>> and reading it. You do have to understand how C strings work and how
>> they are used when passing arguments to commands for it to make sense.
>
> Other shells must go out of their way to suppress it, then.
Most of the other shells remove NUL bytes from `read's input. They
probably do this before checking the delimiter.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/