A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=1038 ====================================================================== Reported By: kre Assigned To: ====================================================================== Project: 1003.1(2013)/Issue7+TC1 Issue ID: 1038 Category: Shell and Utilities Type: Error Severity: Objection Priority: normal Status: New Name: Robert Elz Organization: User Reference: Section: 2.5.3, 2.6 Page Number: 2352 Line Number: 74952 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2016-03-24 18:24 UTC Last Modified: 2017-03-04 07:08 UTC ====================================================================== Summary: Specification relies upon unspecified behaviour ====================================================================== Relationships ID Summary ---------------------------------------------------------------------- related to 0001006 PS1 should be subject to command substi... ======================================================================
---------------------------------------------------------------------- (0003606) kre (reporter) - 2017-03-04 07:08 http://austingroupbugs.net/view.php?id=1038#c3606 ---------------------------------------------------------------------- Just forget about section 2.3 and the rules there, they're for token recognition and have nothing whatever to do with parameter expansion. Parameter expansion (and other expansions, but they're not relevant here) is done in many contexts (I mean for many reasons, I'm not talking of execution contexts or whatever). In each case you simply have a string of characters (in the case of the default PS1 that string contains 2 characters, a dollar, and a space). For parameter expansion, what you do is find the next unquoted $, - which is the first of the two characters here - then look at the character that comes next, to decide what kind of parameter expansion is required (as specified in the section 2.6 preamble). Then follow the rules of 2.6.x (whichever sub-section applies) to actually perform the expansion. The problem here is that the next character is a space, which 2.6 says gives unspecified behaviour - applications are not supposed to do that - but here, it is not the application that did, it is the std, which is the problem. All we need to do to fix it is specify it. It really is simple. (It could also be fixed by quoting the $ in PS1, but that's an inferior solution.) kre Issue History Date Modified Username Field Change ====================================================================== 2016-03-24 18:24 kre New Issue 2016-03-24 18:24 kre Name => Robert Elz 2016-03-24 18:24 kre Section => 2.5.3, 2.6 2016-03-24 18:24 kre Page Number => unknown 2016-03-24 18:24 kre Line Number => unknown 2016-08-11 15:29 Don Cragun Relationship added related to 0001006 2017-03-02 16:22 nick Page Number unknown => 2352 2017-03-02 16:22 nick Line Number unknown => 74952 2017-03-02 16:22 nick Interp Status => --- 2017-03-03 14:42 shware_systems Note Added: 0003589 2017-03-03 15:27 eblake Note Added: 0003590 2017-03-03 15:50 kre Note Added: 0003591 2017-03-03 15:59 joerg Note Added: 0003593 2017-03-03 16:10 geoffclare Note Added: 0003594 2017-03-03 16:41 shware_systems Note Added: 0003595 2017-03-03 16:44 joerg Note Deleted: 0003593 2017-03-03 16:46 chet_ramey Note Added: 0003597 2017-03-03 17:15 Don Cragun Note Added: 0003598 2017-03-03 17:16 Don Cragun Note Edited: 0003598 2017-03-03 18:58 chet_ramey Note Added: 0003599 2017-03-03 19:03 eblake Note Added: 0003600 2017-03-03 19:54 chet_ramey Note Added: 0003601 2017-03-03 19:57 shware_systems Note Added: 0003602 2017-03-03 20:00 shware_systems Note Edited: 0003602 2017-03-03 23:50 kre Note Added: 0003604 2017-03-03 23:52 kre Note Edited: 0003604 2017-03-03 23:55 kre Note Edited: 0003604 2017-03-04 00:37 kre Note Edited: 0003604 2017-03-04 05:19 shware_systems Note Added: 0003605 2017-03-04 07:08 kre Note Added: 0003606 ======================================================================