Minutes of the 30th November 2020 Teleconference Austin-1084 Page 1 of 1 Submitted by Andrew Josey, The Open Group. 2nd December 2020 Attendees: Don Cragun, IEEE PASC OR Nick Stoughton, USENIX, ISO/IEC JTC 1/SC 22 OR Joerg Schilling, FOKUS Fraunhofer Eric Blake, Red Hat, The Open Group OR Geoff Clare, The Open Group Richard Hansen Eric Ackermann, HPI, University of Potsdam Mark Ziegast, SHware Systems Dev. Apologies: Andrew Josey, The Open Group * General news None. * Outstanding actions (Please note that this section has been flushed to shorten the minutes - to locate the previous set of outstanding actions, look to the minutes from 13th June 2019 and earlier) Bug 1254: "asynchronous list" description uses "command" instead of "AND-OR list" OPEN https://austingroupbugs.net/view.php?id=1254 Action: Joerg to investigate how his shell behaves. Bug 700 - Nick to raise this issue with the C committee Bug 713 - Nick to raise with the C committee. Bug 739 - Nick to raise with the C committee. * Current Business Bug 1342: Aliases in command substitutions are handled differently when the command subst is quoted vs not quoted Accept as Marked https://austingroupbugs.net/view.php?id=1342 This item is tagged for TC3-2008. An interpretation is required. Interpretation response: The standard states that alias substitutions are applied when finding the terminating ')' of a command substitution when the command substitution is not within double quotes, but they are not applied when the command substitution is within double quotes, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor. Rationale: Historically some shells used simple parenthesis counting to find the terminating ')' and therefore did not account for aliases. However, such shells never conformed to POSIX, which has always required recursive parsing (see XCU 2.3 item 5). It is likely that observing the behavior of these non-conforming shells was what led to the erroneous addition of "not including the alias substitutions in Section 2.3.1" to XCU 2.2.3 after PASC interpretation 1003.2 #157. Notes to the Editor (not part of this interpretation): On page 2346 line 74721 section 2.2.3, delete: not including the alias substitutions in Section 2.3.1, On page 2357 line 75182 section 2.6.3, change: Command substitution allows the output of a command to be substituted in place of the command name itself. Command substitution shall occur when the command is enclosed as follows to: Command substitution allows the output of one or more commands to be substituted in place of the commands themselves. Command substitution shall occur when command(s) are enclosed as follows On page 2357 line 75190 section 2.6.3, change: with the standard output of the command to: with the standard output of the command(s) On page 2358 lines 75202-75204 section 2.6.3, after applying bug 953, change: It is unspecified whether command is parsed and executed as a program (as for a shell script) or is parsed as a single compound_list that is executed after the entire command has been parsed. With the $(command) form any valid program can be used for command, except a program consisting solely of redirections which produces unspecified results. to: It is unspecified whether the commands string is parsed and executed incrementally as a program (as for a shell script), or is parsed as a single compound_list that is executed after the string has been completely parsed. In addition, it is unspecified whether the terminating ')' of the $(commands) form can result from alias substitution. With the $(commands) form any syntactically correct program can be used for commands, except that: If the commands string consists solely of redirections, the results are unspecified. If the commands string is parsed as a single compound_list, before any commands are executed, alias and unalias commands in commands have no effect during parsing (see [xref to 2.3.1]). Strictly conforming applications shall ensure that the commands string does not depend on alias changes taking effect incrementally as would be the case if parsed and executed as a program. The behavior is unspecified if the terminating ')' is not present in the token containing the command substitution; that is, if the ')' is expected to result from alias substitution. Throughout section 2.6.3 change any remaining occurrences of "command" to "commands" or "the commands string" as appropriate. On page 3730 line 127967 section C.2.6.3, change: While the newer "$()" form can process any kind of valid embedded script, the backquoted form ... to: While the newer "$()" form can process any kind of valid embedded script (with a few caveats; see below), the backquoted form ... On page 3730 line 127985 section C.2.6.3, change: If command is of the form ... to: If the commands string is of the form ... On page 3730 line 127990 section C.2.6.3, after: ... it is unspecified to have a script within "$()" that has only redirections. add the following new paragraph: In POSIX.2-1992 the $(commands) form of command substitution only had unspecified behavior for a commands string consisting solely of redirections. However, two additional unspecified cases have since been added with relation to aliases: Implementations are permitted to parse the entire commands string before executing any of it, and in this case alias and unalias commands in commands have no effect during parsing. For example, the following commands: alias foo='echo "hello globe"' echo $(alias foo='echo "Hello World"';foo) produce the output "hello globe" if the entire commands string is executed as an entire command and produce the output "Hello World" if the commands string is executed incrementally. Although existing aliases are required to be expanded when the shell parses the input that follows the "$(" in order to find the terminating ')' (see [xref to 2.3 Token Recognition]), it is unspecified whether the terminating ')' can result from alias substitution. For example, with this script: alias foo="echo foo )" echo $(foo ; echo bar some shells output lines containing foo and bar whereas other shells report a syntax error because they do not find a terminating ')' for the command substitution. Gettext draft. We will return to this on a future call. The gettext draft in the etherpad is at https://posix.rhansen.org/p/gettext_draft https://posix.rhansen.org/p/gettext_split Next Steps ---------- The next calls are on: December 3rd 2020 (Thursday) This call will be for 90 minutes. December 7th 2020 (Monday) This call will be for 60 minutes. Apologies in advance: Eric Ackermann, Thu 2020-12-03 Tom Thompson. Calls are anchored on US time. (8am Pacific) Please check the calendar invites for dial in details. Bugs are at: https://austingroupbugs.net An etherpad is usually up for the meeting, with a URL using the date format as below: https://posix.rhansen.org/p/20xx-mm-dd (For write access this uses The Open Group single sign on, for those individuals with gitlab.opengroup.org accounts. Please contact Andrew if you need to be setup)