Public bug reported: 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. ** Affects: dash (Ubuntu) Importance: Undecided Status: New -- dash shell stdin handling not POSIX https://bugs.launchpad.net/bugs/165042 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
