Minutes of the 31st March 2016 Teleconference Austin-755 Page 1 of 1 Submitted by Andrew Josey, The Open Group. 31st March 2016 Attendees: Mark Ziegast, SHware Systems Joerg Schilling, FOKUS Fraunhofer Nick Stoughton, USENIX, ISO/IEC JTC 1/SC 22 OR Roger Faulkner, Oracle, The Open Group OR Don Cragun, IEEE PASC OR Geoff Clare, The Open Group Eric Blake, Red Hat Brian Utterback, Oracle Richard Hansen Andrew Josey,The Open Group Martin Rehak, Oracle Apologies: David Clissold, IBM (on for last 20 minutes only) * General news IEEE and The Open Group balloting on TC2 closes on April 1st. At IEEE we now have 90% return and 78% approval. Four comments have been received, pointing to bug report 1035. We plan to have a 10 day recirculation review with that one change. * 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 28 Jan 2016) * Current Business Bug #249: Add standard support for $'...' in shell Reopened http://austingroupbugs.net/bug_view_page.php?bug_id=249 We will return to bug 249 on a future call. Bug #953: Alias expansion is under-specified Accepted as Marked http://austingroupbugs.net/view.php?id=953 This item is tagged for TC3-2008 An interpretation is required. Action: Andrew to start the interpetations clock. Completed after the meeting. 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): On page 2322 lines 73691-73702 (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 delimited and has been identified to be the command name word of a simple command by applying the grammatical rules in Section 2.10, the word shall be subject to alias substitution if: the word does not contain any quoting characters, the word is a valid alias name (see XBD Section 3.10), an alias with that name is in effect, and the word is not recognized as a reserved word (see [xref to 2.4 Reserved Words] and the examples in [xref to XRAT C.2.3.1]). 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. If the value of the alias cannot be tokenized as a simple command (see Section 2.9.1) according to the shell grammar rules (see Section 2.10), or if the alias can be tokenized as a simple command but contains an ASSIGNMENT_WORD token or redirection, the behavior is unspecified. When a word is subject to alias substitution, the value of the alias shall be tokenized as a simple command and the tokens shall replace the word. To prevent infinite loops in recursive aliasing, if the shell is currently processing an alias of the same name, the word shall not be replaced. If the value of the alias replacing the word ends in a that would be unquoted after substitution, 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 . On page 2331 lines 74074-74076 (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 as a compound_list (see [xref to XCU 2.10 Shell Grammar]). Any valid compound_list can be used for command, except a compound_list consisting solely of redirections which produces unspecified results. On page 2325 lines 73782-73785 (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, unlike the contents of a dot script. This distinction matters because it influences when aliases take effect.) On page 2364 line 75304 (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 as a compound_list (see [xref to XCU 2.10 Shell Grammar]), and execute the resulting commands in the current environment. On page 2366 line 75371 (XCU 2.14 eval), change: The constructed command shall be read and executed by the shell. to: The constructed command shall be tokenized (see [xref to XCU 2.3 Token Recognition]), parsed as a compound_list (see [xref to XCU 2.10 Shell Grammar]), and executed by the shell in the current environment. On page 3679 after line 125734 (XRAT C.2.3.1), insert: Implementations differ in how alias substitution is performed when the alias value does not have the form of a simple command. For example, given: $ alias foo='some_command &' $ foo& some, but not all, implementations retokenize the two '&' characters into an && (and) operator. 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. Next Steps ---------- The next call is on April 7, 2016 (a Thursday) Calls are anchored on US time. (8am Pacific) This call will be for the regular 90 minutes. http://austingroupbugs.net An IRC channel will be available for the meeting irc://irc.freenode.net/austingroupbugs An etherpad is usually up for the meeting, with a URL using the date format as below: http://posix@posix.rhansen.org:9001/p/201x-mm-dd password=2115756#