dash shell stdin handling not POSIX
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://
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.
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.