The following issue has been SUBMITTED. ====================================================================== https://www.austingroupbugs.net/view.php?id=1560 ====================================================================== Reported By: calestyo Assigned To: ====================================================================== Project: Issue 8 drafts Issue ID: 1560 Category: Shell and Utilities Type: Enhancement Request Severity: Editorial Priority: normal Status: New Name: Christoph Anton Mitterer Organization: User Reference: Section: 2.6.3 Command Substitution Page Number: 2323 Line Number: 74944 Final Accepted Text: ====================================================================== Date Submitted: 2022-01-31 23:30 UTC Last Modified: 2022-01-31 23:30 UTC ====================================================================== Summary: clarify wording of command substitution Description: In: https://collaboration.opengroup.org/austin/plato/protected/mailarch.php?soph=N&action=show&archive=austin-group-l&num=33716&limit=100&offset=0&sid=
I've had asked whether POSIX requires any conforming shell to consider a last "line" without trailing newline in a command substitution for that purpose, or whether a shell would in principle be allowed to ignore such line, if it had no trailing newline. The answer was, that a shell MUST in fact consider such lines. Desired Action: 1) In: https://collaboration.opengroup.org/austin/plato/protected/mailarch.php?soph=N&action=show&archive=austin-group-l&num=33741&limit=100&offset=0&sid= Geoff Clare proposed a rewording of the current text: From: »replacing the command substitution (the text of the commands string plus the enclosing "$()" or backquotes) with the standard output of the command(s), removing sequences of one or more <newline> characters at the end of the substitution. Embedded <newline> characters before the end of the output shall not be removed; however, they may be treated as field delimiters« To: »replacing the command substitution (the text of the commands string plus the enclosing "$()" or backquotes) with the standard output of the command(s); if the output ends with one or more bytes that have the encoded value of a <newline> character, they shall not be included in the replacement. Any such bytes that occur elsewhere shall be included in the replacement; however, they might be treated as field delimiters« 2) The above change would seem to already indicate that the standard output is to be taken as bytes. Similarly, the line "If the output contains any null bytes, the behavior is unspecified." may be considered an indication that anything *except* NUL bytes need to be substituted I personally, would further suggest to directly mention this, instead of just indirectly. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2022-01-31 23:30 calestyo New Issue 2022-01-31 23:30 calestyo Name => Christoph Anton Mitterer 2022-01-31 23:30 calestyo Section => 2.6.3 Command Substitution 2022-01-31 23:30 calestyo Page Number => 2323 2022-01-31 23:30 calestyo Line Number => 74944 ======================================================================
