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.