dash -i -c may prompt for input from stdin/terminal

Bug #1196127 reported by Richard Hansen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dash (Ubuntu)
New
Undecided
Unassigned

Bug Description

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html#tag_20_117_06 says:

> 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).

However, if you run:

    dash -i -c 'if'

then dash will drop to a prompt waiting for input from the terminal/stdin (after printing an error message for the legitimate syntax error. It should simply exit.

Another way to test this:

    dash -i -c 'read foo'

and then hit Ctrl-C. It will drop to a prompt when it should exit.

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.