dash shell stdin handling not POSIX

Bug #165042 reported by Jim Lowe
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Standard Input is not being handled according to the POSIX spec
for a POSIX 'sh'

$ (echo "(sed -e s/a/d/);"; echo abc) | bash -s
dbc
$ (echo "(sed -e s/a/d/);"; echo abc) | dash -s
dash: abc: not found
$

ksh handles this correctly, as does zsh and /usr/xpg4/bin/sh on OpenSolaris

The relevant citation is this
http://www.opengroup.org/onlinepubs/009695399/utilities/sh.html

STDIN
-----
    The standard input shall be used only if one of the
    following is true:
        * The -s option is specified.
        * The -c option is not specified and no operands are specified.
        * The script executes one or more commands that require input
          from standard input (such as a read command that does not
          redirect its input).

See the INPUT FILES section.

When the shell is using standard input and it invokes a command that
also uses standard input, the shell shall ensure that the standard
input file pointer points directly after the command it has read when the
command begins execution. It shall not read ahead in such a manner that
any characters intended to be read by the invoked command are consumed
by the shell (whether interpreted by the shell or not) or that characters
that are not read by the invoked command are not seen by the shell. When
the command expecting to read standard input is started asynchronously
by an interactive shell, it is unspecified whether characters are read
by the command or interpreted by the shell.

Revision history for this message
xteejx (xteejx-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue for you. Can you try with the latest Ubuntu release? Thanks in advance.

Changed in dash (Ubuntu):
status: New → Incomplete
Revision history for this message
xteejx (xteejx-deactivatedaccount) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in dash (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Richard Hansen (rhansen) wrote :

Still a problem in raring.

Changed in dash (Ubuntu):
status: Invalid → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.