Minutes of the 7th February 2019 Teleconference Austin-907 Page 1 of 1 Submitted by Andrew Josey, The Open Group. 8th February 2019 Attendees: Don Cragun, IEEE PASC OR Nick Stoughton, USENIX, ISO/IEC JTC 1/SC 22 OR Mark Ziegast, SHware Systems Dev. Geoff Clare, The Open Group Eric Blake, Red Hat Joerg Schilling FOKUS Fraunhofer Andrew Josey, The Open Group * General news Andrew took an action to check in with Martin Rehak on participation. This is open, awaiting further feedback from Oracle. * 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 9 March 2018 and earlier) Bug 1077: Recommend support for wide-character regcomp and regexec and/or specify multi-byte behavior OPEN http://austingroupbugs.net/bug_view_page.php?bug_id=1077 Andrew has completed the action to ping his Apple contact and is awaiting a reply. Bug 1122: POSIX should include gettext() and friends OPEN http://austingroupbugs.net/view.php?id=1122 Left open as an action is still in progress to flesh out a complete proposal. * Current Business Bug 1171: doesn’t allow to include namespace anymore Accepted as markd http://austingroupbugs.net/view.php?id=1171 This item is tagged TC3-2008. Change page 399 lines 13572-13575 () from: The header shall define the timeval structure, which shall include at least the following members: time_t tv_sec Seconds. suseconds_t tv_usec Microseconds. to: The header shall define the fd_set type and the timeval structure as described in . Delete page 399 line 13582: The header shall define the fd_set type as described in . Change the RATIONALE section on page 400 line 13609 from: None. to: The header refers to for the definition of the timeval structure, instead of the other way round, because is an optional (XSI) header whereas is mandatory. Bug 953: Alias expansion is under-specified Accepted as Marked http://austingroupbugs.net/view.php?id=953 An interpretation is required. This item is tagged for TC3-2008. Interpretation response: The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor. Rationale: There is widespread existing practice to follow, and the standard developers have attempted to codify this in the changes below. Notes to the Editor (not part of this interpretation): All page and line numbers are for the 2016 and 2018 editions. On page 2348 line 74794-74805 (XCU 2.3.1 Alias Substitution), change: After a token has been delimited, but before applying the grammatical rules in Section 2.10, a resulting word that is identified to be the command name word of a simple command shall be examined to determine whether it is an unquoted, valid alias name. However, reserved words in correct grammatical context shall not be candidates for alias substitution. A valid alias name (see XBD Section 3.10) shall be one that has been defined by the alias utility and not subsequently undefined using unalias. Implementations also may provide predefined valid aliases that are in effect when the shell is invoked. To prevent infinite loops in recursive aliasing, if the shell is not currently processing an alias of the same name, the word shall be replaced by the value of the alias; otherwise, it shall not be replaced. If the value of the alias replacing the word ends in a , the shell shall check the next command word for alias substitution; this process shall continue until a word is found that is not a valid alias or an alias value does not end in a . to: After a token has been categorized as type TOKEN (see [xref to 2.10.1]), including (recursively) any token resulting from an alias substitution, the TOKEN shall be subject to alias substitution if: the TOKEN does not contain any quoting characters, the TOKEN is a valid alias name (see XBD Section 3.10), an alias with that name is in effect, the TOKEN did not either fully or, optionally, partially result from an alias substitution of the same alias name at any earlier recursion level, and the TOKEN could be parsed as the command name word of a simple command (see [xref to Section 2.10]), based on this TOKEN and the tokens (if any) that preceded it, but ignoring whether any subsequent characters would allow that, except that if the TOKEN meets the above conditions and would be recognized as a reserved word (see [xref to 2.4 Reserved Words]) if it occurred in an appropriate place in the input, it is unspecified whether the TOKEN is subject to alias substitution. When a TOKEN is subject to alias substitution, the value of the alias shall be processed as if it had been read from the input instead of the TOKEN, with token recognition (see [xref to 2.3 Token Recognition]) resuming at the start of the alias value. When the end of the alias value is reached, the shell may behave as if an additional character had been read from the input after the TOKEN that was replaced. If it does not add this , it is unspecified whether the current token is delimited before token recognition is applied to the character (if any) that followed the TOKEN in the input. Note: a future version of this standard may disallow adding this . If the value of the alias replacing the TOKEN ends in a that would be unquoted after substitution, and optionally if it ends in a that would be quoted after substitution, the shell shall check the next token in the input, if it is a TOKEN, for alias substitution; this process shall continue until a TOKEN is found that is not a valid alias or an alias value does not end in such a . An implementation may defer the effect of a change to an alias but the change shall take effect no later than the completion of the currently executing complete_command (see [xref to XCU 2.10 Shell Grammar]). Changes to aliases shall not take effect out of order. Implementations may provide predefined aliases that are in effect when the shell is invoked. On page 2351 line 74901-74904 (XCU 2.5.3 Shell Variables) change: This variable, when and only when an interactive shell is invoked, shall be subjected to parameter expansion (see Section 2.6.2) by the shell and the resulting value shall be used as a pathname of a file containing shell commands to execute in the current environment. to: This variable, when and only when an interactive shell is invoked, shall be subjected to parameter expansion (see Section 2.6.2) by the shell and the resulting value shall be used as a pathname of a file. Before any interactive commands are read, the shell shall tokenize (see [xref to XCU 2.3 Token Recognition]) the contents of the file, parse the tokens as a program (see [xref to XCU 2.10 Shell Grammar]), and execute the resulting commands in the current environment. (In other words, the contents of the ENV file are not parsed as a single compound_list. This distinction matters because it influences when aliases take effect.) On page 2358 line 75202-75204 (XCU 2.6.3 Command Substitution), change: With the $(command) form, all characters following the open parenthesis to the matching closing parenthesis constitute the command. Any valid shell script can be used for command, except a script consisting solely of redirections which produces unspecified results. to: With the $(command) form, all characters following the open parenthesis to the matching closing parenthesis constitute the command. With both the backquoted and $(command) forms, command shall be tokenized (see [xref to XCU 2.3 Token Recognition]) and parsed (see [xref to XCU 2.10 Shell Grammar]). 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. On page 2393 line 76554 (XCU 2.14 dot DESCRIPTION), change: The shell shall execute commands from the file in the current environment. to: The shell shall tokenize (see [xref to XCU 2.3 Token Recognition]) the contents of the file, parse the tokens (see [xref to XCU 2.10 Shell Grammar]), and execute the resulting commands in the current environment. It is unspecified whether the commands are parsed and executed as a program (as for a shell script) or are parsed as a single compound_list that is executed after the entire file has been parsed. On page 2394 line 76620 (XCU 2.14 eval), change: The eval utility shall construct a command by concatenating arguments together, separating each with a character. The constructed command shall be read and executed by the shell. to: The eval utility shall construct a command string by concatenating arguments together, separating each with a character. The constructed command string shall be tokenized (see [xref to XCU 2.3 Token Recognition]), parsed (see [xref to XCU 2.10 Shell Grammar]), and executed by the shell in the current environment. It is unspecified whether the commands are parsed and executed as a program (as for a shell script) or are parsed as a single compound_list that is executed after the entire constructed command string has been parsed. On page 2459 line 78855 (XCU alias), change: An alias definition provides a string value that shall replace a command name when it is encountered; see [xref to 2.3.1]. to: An alias definition provides a string value that shall replace a command name when it is encountered. For information on valid string values, and the processing involved, see [xref to 2.3.1]. On page 2460 line 78908 (XCU alias APPLICATION USAGE), change: None. to: Care should be taken to avoid alias values that end with a character that could be treated as part of an operator token, as it is unspecified whether the character that follows the alias name in the input can be used as part of the same token (see [xref to 2.3.1]). For example, with: $ alias foo='echo 0' $ foo>&2 the shell can either pass the argument '0' to echo and redirect fd 1 to fd 2, or pass no arguments to echo and redirect fd 0 to fd 2. Changing it to: $ alias foo='echo "0"' avoids this problem. The alternative of adding a after the '0' would also avoid the problem, but in addition it would alter the way the alias works, as described in [xref to 2.3.1]. Likewise, given: $ alias foo='some_command &' $ foo& the shell may combine the two '&' characters into an && (and) operator. Since the alias cannot pass arguments to some_command and thus can be expected to be invoked without arguments, adding a after the '&' would be an acceptable way to prevent this. Alternatively, the alias could be specified as a grouping command: $ alias foo='{ some_command & }' Problems can occur for tokens other than operators as well, if the alias is used in unusual ways. For example, with: $ alias foo='echo $' $ foo((123)) some shells combine the '$' and the "((123))" to form an arithmetic expansion, but others do not (resulting in a syntax error). On page 3721 after line 127547 (XRAT C.2.3.1), insert: Some implementations add a after the alias value when performing alias substitution in order to prevent the last character of the alias value and the first character after the alias name in the input from combining to form an operator. However, the extra can have side-effects in other situations, such as if the alias value ends with an unquoted . Implementations which do this are encouraged to change to an alternative method of delimiting a partial operator token at the end of an alias value. Some, but not all, shell implementations do not process changes to alias definitions until the current compound_list (see [xref to XCU 2.10 shell grammar]) has completed. In these shells, alias changes do not take effect until the end of the dot script, eval command, function invocation, if statement, case statement, for statement, while statement, or until statement containing the alias change. Many shell implementations execute the contents of a file, typically ~/.profile, when invoked as a login shell. The standard developers are unaware of any such implementations that process the contents of ~/.profile (and similar startup files) as a single compound_list, so alias changes in ~/.profile typically do take effect before the end of ~/.profile. Bug 1055: unspecified how much is parsed before execution begins Re-opened http://austingroupbugs.net/view.php?id=1055 Reopening because the resolution includes a change to XCU 2.3.1 that overlaps with the one proposed in Note: 0003113 of bug 0000953 (which was reopened after that proposal). To be continued at the next call. Next Steps ---------- The next calls are on: February 11th 2019 (Monday). This call will be for 60 minutes. February 14th 2019 (Thursday) This call will be for 90 minutes. Apologies in advance: 2019-02-14 Mark Ziegast Calls are anchored on US time. (8am Pacific) http://austingroupbugs.net An etherpad is usually up for the meeting, with a URL using the date format as below: https://posix.rhansen.org/p/201x-mm-dd username=posix password=2115756#