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


Groups > gnu.bash.bug > #15840

Re: read and inconsistent handling of trailing null field?

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: read and inconsistent handling of trailing null field?
Date 2020-01-29 10:30 -0500
Message-ID <mailman.37.1580311836.2384.bug-bash@gnu.org> (permalink)
References <122693AD-B562-43A5-BE64-58B02C72B6EA@gmail.com> <f6382f38-add8-731a-6d47-77d292d013c8@case.edu>

Show all headers | View raw


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/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

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

csiph-web