Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001757 [Issue 8 drafts] Shell and Utilities Editorial Error 2023-07-15 01:59 2023-08-17 11:04
Reporter larryv View Status public  
Assigned To
Priority normal Resolution Accepted  
Status Applied   Product Version Draft 3
Name Lawrence Velázquez
Organization
User Reference
Section expr
Page Number 2895
Line Number 96621
Final Accepted Text
Summary 0001757: expr: incorrectly describes BRE subexpression as "[\(...\)]"
Description The 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 Action Change:
"[\(...\)]"
to:
"\(...\)"
Tags applied_after_i8d3, tc3-2008
Attached Files

- Relationships

-  Notes
(0006390)
larryv (reporter)
2023-07-18 04:22

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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker