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
0001550 [Issue 8 drafts] Shell and Utilities Editorial Enhancement Request 2022-01-14 05:32 2022-01-14 06:54
Reporter calestyo View Status public  
Assigned To
Priority normal Resolution Open  
Status New   Product Version Draft 2.1
Name Christoph Anton Mitterer
Organization
User Reference
Section Utilities, sed
Page Number 3132, ff. (in the draft)
Line Number see below
Final Accepted Text
Summary 0001550: clarifications/ambiguities in the description of context addresses and their delimiters for sed
Description Hey.

First of all, I've asked/reported all his already at the mailing list:
"sed and delimiters that are also special characters to REs"
https://collaboration.opengroup.org/austin/plato/protected/mailarch.php?soph=N&action=show&archive=austin-group-l&num=33587&limit=100&offset=0&sid= [^]
(unfortunately there seems to be no thread-view)


I was looking into using BREs/EREs within delimiters, which as far as POSIX is concerned should be only sed, and in:
- context addresses (e.g. /RE/ or \xREx with x being another delimiter, of which the 1st needs to be quoted if not / )
- s-command
- y-command



For simplicity, this ticket covers only proposals with respect to the context addresses.



1) In the chapter "Addresses in sed":

»which consists of an RE, as described in Regular Expressions in sed, preceded and followed by a delimiter, usually a <slash>«
(106070 et seq., draft PDF)

I would append something like:
"but see <chapter:Regular Expressions in sed> for details when other delimiters shall be used"

The motivation is, that if one reads this part alone, one might easily think that any other character could be used, but:
- any other character than / requires the first delimiter to be quoted with a \
- not all other characters are allowed as delimiter (namely \ and newline are not)




2) In the chapter "Regular Expressions in sed" (106070, draft PDF):

»In a context address, the construction "\cREc", where c is any character other than <backslash> or <newline>, shall be identical to "/RE/". If the character designated by c appears following a <backslash>, then it shall be considered to be that literal character, which shall not terminate the RE.«
(106087 et seq., draft PDF)

a) After »shall be identical to "/RE/"« I'd add a clarification like:
"(that is: when a delimiter other than <slash> is used it's first occurrence)"
Simply to make that rather cryptic text a bit easier to understand.

b) It should further be added (the answer to which I don't know), whether or not the first delimiter may also be quoted if a slash is used, i.e. whether \/RE/ is equal to /RE/ (which the first sentence would imply.

c) The sentence:
»If the character designated by c appears following a <backslash>, then it shall be considered to be that literal character, which shall not terminate the RE.«
seems IMO ambiguous or wrong:

AFAIU, it is however every \c *AFTER the first delimiter* (that is after the first \c), that is taken literally.


One might even think about moving that whole paragraph (i.e. the fist bullet point) up into "Addresses in sed",... cause that rather explains the context addresses and the quoting of their delimiter, when it's used inside the context address (which is admittedly an RE, but still).
Desired Action see above, clarify things and resolve ambiguities


Thanks,
Chris.
Tags No tags attached.
Attached Files

- Relationships
related to 0001551New sed: ambiguities in the how BREs/EREs are parsed/interpreted between delimiters (especially when these are special characters) 

-  Notes
(0005601)
calestyo (reporter)
2022-01-14 05:40

https://www.austingroupbugs.net/view.php?id=1551 [^] may be a bit related to all this
(0005603)
Don Cragun (manager)
2022-01-14 06:54

This was originally filed against the Issue 7 + TC2 project, but the page and line numbers are from Issue 8 draft 2.1. It has been moved to the Issue 8 project.

- Issue History
Date Modified Username Field Change
2022-01-14 05:32 calestyo New Issue
2022-01-14 05:32 calestyo Name => Christoph Anton Mitterer
2022-01-14 05:32 calestyo Section => Utilities, sed
2022-01-14 05:32 calestyo Page Number => 3132, ff. (in the draft)
2022-01-14 05:32 calestyo Line Number => see below
2022-01-14 05:40 calestyo Note Added: 0005601
2022-01-14 06:34 Don Cragun Relationship added related to 0001551
2022-01-14 06:52 Don Cragun Project 1003.1(2016/18)/Issue7+TC2 => Issue 8 drafts
2022-01-14 06:54 Don Cragun Note Added: 0005603
2022-01-14 06:54 Don Cragun version => Draft 2.1


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