View Issue Details

IDProjectCategoryView StatusLast Update
0001757Issue 8 draftsShell and Utilitiespublic2024-06-11 09:12
Reporterlarryv Assigned To 
PrioritynormalSeverityEditorialTypeError
Status ClosedResolutionAccepted 
Product VersionDraft 3 
NameLawrence Velázquez
Organization
User Reference
Sectionexpr
Page Number2895
Line Number96621
Final Accepted Text
Summary0001757: expr: incorrectly describes BRE subexpression as "[\(...\)]"
DescriptionThe behavior of the expr ':' operator when its pattern operand contains a BRE subexpression is described on page 2895, lines 96620-96623:
Alternatively, if the pattern contains at least one regular expression subexpression "[\(...\)]", the string matched by the back-reference expression "\1" shall be returned. If the back-reference expression "\1" does not match, then the null string shell be returned.
This implies that subexpressions include or must be enclosed between '[' and ']'. However, as per XBD Section 9.3.5, '[' introduces a bracket expression, within which a subexpression cannot occur (since "\(" is not treated specially).

This is the corresponding text from Commands and Utilities, Issue 5, page 337:
Alternatively, if the pattern contains at least one regular expression subexpression [\(...\)], the string corresponding to \1 will be returned.
It seems clear that '[' and ']' were being used in a parenthetical, not literal, capacity, but Issue 6 (https://pubs.opengroup.org/onlinepubs/009695399/utilities/expr.html) missed that and simply wrapped the whole thing in quotation marks. It's been wrong ever since.
Desired ActionChange:
"[\(...\)]"
to:
"\(...\)"
Tagsapplied_after_i8d3, tc3-2008

Activities

larryv

2023-07-18 04:22

reporter   bugnote:0006390

This report applies to Issue 6 and Issue 7 as well; apologies if I miscategorized it.

Issue History

Date Modified Username Field Change
2023-07-15 01:59 larryv New Issue
2023-07-15 01:59 larryv Name => Lawrence Velázquez
2023-07-15 01:59 larryv Section => expr
2023-07-15 01:59 larryv Page Number => 2895
2023-07-15 01:59 larryv Line Number => 96621
2023-07-18 04:22 larryv Note Added: 0006390
2023-07-24 16:28 Don Cragun Status New => Resolved
2023-07-24 16:28 Don Cragun Resolution Open => Accepted
2023-07-24 16:29 Don Cragun Tag Attached: issue8
2023-07-24 16:31 Don Cragun Tag Attached: tc3-2008
2023-07-24 16:31 Don Cragun Tag Detached: issue8
2023-08-17 11:04 geoffclare Status Resolved => Applied
2023-08-17 11:04 geoffclare Tag Attached: applied_after_i8d3
2024-06-11 09:12 agadmin Status Applied => Closed