A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=1254 ====================================================================== Reported By: stephane Assigned To: ====================================================================== Project: 1003.1(2016)/Issue7+TC2 Issue ID: 1254 Category: Shell and Utilities Type: Error Severity: Objection Priority: normal Status: New Name: Stephane Chazelas Organization: User Reference: Section: 2.9.3.1 Asynchronous Lists Page Number: 2370 (in 2018 edition, not 2016) Line Number: the whole 2.9.3.1 section and also 76177 (execution environment), 115763 (wait), 128448 (rationale), 74883 ($!) Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2019-06-08 09:14 UTC Last Modified: 2019-06-10 18:34 UTC ====================================================================== Summary: "asynchronous list" description uses "command" instead of "AND-OR list" ======================================================================
---------------------------------------------------------------------- (0004416) stephane (reporter) - 2019-06-10 18:34 http://austingroupbugs.net/view.php?id=1254#c4416 ---------------------------------------------------------------------- I think that it makes sense to address the other objections I raised in http://austingroupbugs.net/view.php?id=760#c4410 and http://austingroupbugs.net/view.php?id=760#c4411 of http://austingroupbugs.net/view.php?id=760 in this same bug. the new bug760 wording of: > If job control is disabled (see set, −m), the standard input for > an asynchronous list, before any explicit redirections are > performed, shall be considered to be assigned to a file that has > the same properties as /dev/null. This shall not happen if job > control is enabled. In all cases, explicit redirection of > standard input shall override this activity. seems to assume "my" definition of "asynchronous list" as it doesn't make sense to speak of "the standard input for an asynchronous list" when that asynchronous list can be "cmd1 & cmd2 &". If "redirection of standard input shall override this activity", that would imply in cmd1 < foo & cmd2 & cmd2's stdin would not be redirected to /dev/null. IMO, after "asynchronous list" has been clearly defined as "AND-OR-list followed by &", and maybe renamed to "asynchronous AND-OR list", that whole paragraph should be changed to something like: } If job control is disabled (see set, −m), an implementation may } choose to assign the standard input of an asynchronous AND-OR } list to an open file description that behaves as if /dev/null } had been opened in read-only. } } This shall not happen if job control is enabled. } } Where and if that happens, that shall happen before any explicit } redirection of any command in the asynchronous AND-OR list is } processed. } } A portable application that needs to make sure that is done } would need to make the /dev/null redirection explicitly: } } < /dev/null cmd1 | cmd2 && < /dev/null cmd3 & } } Or } } { cmd1 | cmd2 && cmd3 ; } < /dev/null & } } A portable application that needs to make sure it is not done } would need to duplicate the original stdin outside of the } asynchronous AND-OR list and restore it inside for instance as: } } { <&3 3<&- cmd1 | 3<&- cmd2 && <&3 3<&- cmd3 & } <&3 } } Or: } } { { cmd1 | cmd2 && cmd3 ; } <&3 3<&- & } } } As whether it is done or not in: } } cmd1 | cmd2 && cmd3 & } } Is unspecified. Issue History Date Modified Username Field Change ====================================================================== 2019-06-08 09:14 stephane New Issue 2019-06-08 09:14 stephane Name => Stephane Chazelas 2019-06-08 09:14 stephane Section => 2.9.3.1 Asynchronous Lists 2019-06-08 09:14 stephane Page Number => 2370 (in 2018 edition, not 2016) 2019-06-08 09:14 stephane Line Number => the whole 2.9.3.1 section and also 76177 (execution environment), 115763 (wait), 128448 (rationale), 74883 ($!) 2019-06-10 18:34 stephane Note Added: 0004416 ======================================================================
