[Bug 165042] Re: dash shell stdin handling not POSIX
a7x
165042 at bugs.launchpad.net
Sat Jun 29 20:34:12 UTC 2013
Still a problem in raring.
** Changed in: dash (Ubuntu)
Status: Invalid => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dash in Ubuntu.
https://bugs.launchpad.net/bugs/165042
Title:
dash shell stdin handling not POSIX
Status in “dash” package in Ubuntu:
Confirmed
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dash/+bug/165042/+subscriptions
More information about the foundations-bugs
mailing list