bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: document that read built-in can't return zero-length string in the m


From: Greg Wooledge
Subject: Re: document that read built-in can't return zero-length string in the middle of input
Date: Thu, 11 Jan 2024 10:55:38 -0500

On Thu, Jan 11, 2024 at 09:29:03AM -0500, Chet Ramey wrote:
> The read builtin skips over NUL characters because you can't store them
> as part of the value of a shell variable. That seems obvious.

I would argue that it's not obvious at all when using -N.  The help
text for -N says "return only after reading exactly NCHARS characters".
Having it return after reading NCHARS + 1 characters, just because one
of them was NUL, is a surprise.

> What would you like to see documented? That NUL characters don't count
> towards the number of characters read to satisfy -N?

That would work for me, though I can't speak for the OP.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]