[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
standards/52406: POSIX requires sh(1)ell interactivity for IN/ERR, not IN/OUT
>Synopsis: POSIX requires sh(1)ell interactivity for IN/ERR, not IN/OUT
>Arrival-Date: Sat Jul 15 13:30:00 +0000 2017
Subject: Re: Future shell work - comments reqyuested
Date: Sat, 15 Jul 2017 19:52:42 +0700
In said thread it was revealed that NetBSD shell (and BSD Mail) treat isatty(STDIN/STDOUT) as being interactive, whereas POSIX requires isatty(STDIN/STDERR) for this condition.
POSIX 2008/Cor 2-2016, p. 3226, line 108308 ff.:
If the −i option is present, or if there are no operands and the shell?s standard input and
standard error are attached to a terminal, the shell is considered to be interactive.
and, ditto, p. 3239, line 108848 ff.:
Standard input and standard error are the files that determine whether a shell is interactive
when −i is not specified. For example:
sh > file
sh 2> file
create interactive and non-interactive shells, respectively. Although both accept terminal input, the results of error conditions are different, as described in Section 2.8.1 (on page 2363); in the second example a redirection error encountered by a special built-in utility aborts the shell.
I expect a painful and lengthy code audit for BSD Mail. I do not know about the shell.
Main Index |
Thread Index |