Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15840 > unrolled thread

Re: read and inconsistent handling of trailing null field?

Started byChet Ramey <chet.ramey@case.edu>
First post2020-01-29 10:30 -0500
Last post2020-01-29 10:30 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: read and inconsistent handling of trailing null field? Chet Ramey <chet.ramey@case.edu> - 2020-01-29 10:30 -0500

#15840 — Re: read and inconsistent handling of trailing null field?

FromChet Ramey <chet.ramey@case.edu>
Date2020-01-29 10:30 -0500
SubjectRe: read and inconsistent handling of trailing null field?
Message-ID<mailman.37.1580311836.2384.bug-bash@gnu.org>
On 1/29/20 10:19 AM, Clint Hepner wrote:

> Bash Version: 5.0
> Patch Level: 11
> Release Status: release
> 
> Description:
>         
> read seems to incorrectly drop a null field when performing word-splitting and more fields than variables.
> 
> All the examples below use
> 
>     IFS== read -r n v
> 
> for some input of the form ``name=var...``
> 
> 
> The relative bit of the POSIX spec concerns how to set the variables when there are fewer arguments
> to read than there are fields.

There are exactly two variables and two (split) arguments.

"The shell shall treat each character of the IFS as a delimiter and use the
delimiters as field terminators to split..."

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web