View Issue Details

IDProjectCategoryView StatusLast Update
00009581003.1(2013)/Issue7+TC1Shell and Utilitiespublic2019-06-10 08:54
Reporterstephane Assigned To 
PrioritynormalSeverityEditorialTypeEnhancement Request
Status ClosedResolutionAccepted As Marked 
NameStephane Chazelas
Organization
User Reference
Sectionhttp://pubs.opengroup.org/onlinepubs/9699919799/utilities/read.html
Page Number3154
Line Number105406
Interp Status---
Final Accepted TextSee 0000958:0002762
Summary0000958: misleading description for the "read" utility
DescriptionThe "read" utility is currently described as:

   read - read a line from standard input

That is misleading.

First, "read" may read more than one line (it reads a backslash-continued line, which is different from the usual definition of "line").

Then, its primary purpose is to assign shell variables from *words* read from standard input (using a complex processing algorithm)

We see too many scripts around that do:

while read line; do...

while the authors meant:

while IFS= read -r line; do
or
while line=`line`; do # that one removed in SUSv3

Having a description like "read a line from standard input" just encourages that behaviour.
Desired ActionChange the description in the top "Name" section to:

   read - read words from standard input into shell variables

The first paragraph after that could also be clarified.
Tagstc2-2008

Activities

nick

2015-07-16 15:47

manager   bugnote:0002762

Last edited: 2015-07-16 15:51

On page 3154 line 105406, change:
read — read a line from standard input

to:
read — read from standard input into shell variables

On page 3154 change line 105410 from:
The read utility shall read a single line from standard input.

to:
The read utility shall read a single logical line from standard input into one or more shell variables.


Issue History

Date Modified Username Field Change
2015-06-12 09:45 stephane New Issue
2015-06-12 09:45 stephane Name => Stephane Chazelas
2015-06-12 09:45 stephane Section => http://pubs.opengroup.org/onlinepubs/9699919799/utilities/read.html
2015-06-12 09:45 stephane Page Number => http://pubs.opengroup.org/onlinepubs/9699919799/utilities/read.html
2015-06-12 09:45 stephane Line Number => Name section
2015-07-02 16:29 rhansen Page Number http://pubs.opengroup.org/onlinepubs/9699919799/utilities/read.html => 3154
2015-07-02 16:29 rhansen Line Number Name section => 105406
2015-07-02 16:29 rhansen Interp Status => ---
2015-07-16 15:47 nick Note Added: 0002762
2015-07-16 15:48 nick Final Accepted Text => See 0000958:0002762
2015-07-16 15:48 nick Status New => Resolved
2015-07-16 15:48 nick Resolution Open => Accepted As Marked
2015-07-16 15:48 nick Tag Attached: tc2-2008
2015-07-16 15:51 nick Note Edited: 0002762
2019-06-10 08:54 agadmin Status Resolved => Closed