View Issue Details

IDProjectCategoryView StatusLast Update
00002051003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionAccepted As Marked 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Section2.9.2
Page Number2318
Line Number73175
Interp Status---
Final Accepted TextSee 0000205:0000385
Summary0000205: Shell pipeline connection requirement too vague
DescriptionThe requirement for the way commands in a pipeline are connected
is stated as:

    "The standard output of all but the last command shall be
    connected to the standard input of the next command."

This is too vague; it needs to say precisely how they are
connected. Otherwise implementations could, for example,
connect the commands using a pseudo-terminal which would
cause some commands to behave differently (such as ls
writing multi-column output).
Desired ActionChange

    "The standard output of all but the last command shall be
    connected to the standard input of the next command."

to

    "For each command but the last, the shell shall connect the
    standard output of the command to the standard input of the
    next command by creating a pipe and passing the write end of
    the pipe as the standard output of the command and the read
    end of the pipe as the standard input of the next command."
Tagstc1-2008

Activities

eblake

2010-01-06 13:36

manager   bugnote:0000367

According to http://lists.gnu.org/archive/html/bug-coreutils/2009-09/msg00265.html, most shells use pipe(), but ksh uses a socket. The proposed wording needs to account for the ksh implementation.

geoffclare

2010-01-06 15:04

manager   bugnote:0000368

I tried the latest ksh93 binary (93t+) and found that it uses a socket
pair on Linux, but a pipe on OpenSolaris. (I originally tried 93s+ on
Linux, then downloaded the latest to make sure it wasn't a difference
between 93s+ and 93t+.) I assume there must be a good reason for it
choosing to use a socket pair on some systems instead of a pipe, so I
agree the wording should allow this behaviour.

I suggest:

    "For each command but the last, the shell shall connect the
    standard output of the command to the standard input of the
    next command by creating either a pipe or a unidirectional
    socket pair (an unbound pair of connected sockets of type
    SOCK_STREAM with one of the pair shut down for sending and
    the other shut down for receiving - see [xref to socketpair()]
    and [xref to shutdown()]) and passing the writable end of
    the pipe or socket pair as the standard output of the command
    and the readable end of the pipe or socket pair as the standard
    input of the next command."

Don Cragun

2010-02-11 16:30

manager   bugnote:0000385

Change

    "The standard output of all but the last command shall be
    connected to the standard input of the next command."

to

    "For each command but the last, the shell shall connect the
    standard output of the command to the standard input of the
    next command as if by creating a pipe and passing the write end of
    the pipe as the standard output of the command and the read
    end of the pipe as the standard input of the next command."

Issue History

Date Modified Username Field Change
2010-01-06 11:31 geoffclare New Issue
2010-01-06 11:31 geoffclare Status New => Under Review
2010-01-06 11:31 geoffclare Assigned To => ajosey
2010-01-06 11:31 geoffclare Name => Geoff Clare
2010-01-06 11:31 geoffclare Organization => The Open Group
2010-01-06 11:31 geoffclare Section => 2.9.2
2010-01-06 11:31 geoffclare Page Number => 2318
2010-01-06 11:31 geoffclare Line Number => 73175
2010-01-06 11:31 geoffclare Interp Status => ---
2010-01-06 13:36 eblake Note Added: 0000367
2010-01-06 15:04 geoffclare Note Added: 0000368
2010-02-11 16:30 Don Cragun Note Added: 0000385
2010-02-11 16:30 Don Cragun Status Under Review => Resolved
2010-02-11 16:30 Don Cragun Resolution Open => Accepted As Marked
2010-02-11 16:31 Don Cragun Final Accepted Text => See 0000205:0000385
2010-08-27 13:00 ajosey Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Resolved => Closed