[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.
- document that read built-in can't return zero-length string in the middle of input, ilya Basin, 2024/01/11
- Re: document that read built-in can't return zero-length string in the middle of input, Chet Ramey, 2024/01/11
- Re: document that read built-in can't return zero-length string in the middle of input,
Greg Wooledge <=
- Re: document that read built-in can't return zero-length string in the middle of input, alex xmb sw ratchev, 2024/01/11
- Re: document that read built-in can't return zero-length string in the middle of input, Ángel, 2024/01/11
- Re: document that read built-in can't return zero-length string in the middle of input, Robert Elz, 2024/01/12
- Re: document that read built-in can't return zero-length string in the middle of input, Greg Wooledge, 2024/01/12
- Re: document that read built-in can't return zero-length string in the middle of input, Robert Elz, 2024/01/12
- Re: document that read built-in can't return zero-length string in the middle of input, Lawrence Velázquez, 2024/01/12
- Re: document that read built-in can't return zero-length string in the middle of input, Greg Wooledge, 2024/01/12