A NOTE has been added to this issue. 
====================================================================== 
https://austingroupbugs.net/view.php?id=1556 
====================================================================== 
Reported By:                calestyo
Assigned To:                
====================================================================== 
Project:                    Issue 8 drafts
Issue ID:                   1556
Category:                   Shell and Utilities
Type:                       Clarification Requested
Severity:                   Objection
Priority:                   normal
Status:                     New
Name:                       Christoph Anton Mitterer 
Organization:                
User Reference:              
Section:                    Utilities, sed / 9.3.5 RE Bracket Expression 
Page Number:                - 
Line Number:                - 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2022-01-18 01:07 UTC
Last Modified:              2022-01-18 16:30 UTC
====================================================================== 
Summary:                    clarify meaning of \n used in a bracket expression
in a sed context address or s-command
====================================================================== 

---------------------------------------------------------------------- 
 (0005623) kre (reporter) - 2022-01-18 16:30
 https://austingroupbugs.net/view.php?id=1556#c5623 
---------------------------------------------------------------------- 
Re https://austingroupbugs.net/view.php?id=1556#c5622

I think you're misreading "The escape sequence '\n' shall ..." as:

"The two character sequence backslash followed by n, which we call an
escape sequence, shall ..."

Whereas what it really is, is:

"The escape sequence (which is an escape character, followed by some other
defined sequence of characters [in sed, I think, but might be wrong, only
ever
one following character]) with an 'n' as its second and final character
(that
is '\n') shall ..."

If you read it that way, you can see there is no need for anything to ever
say anything like

   "… unless the preceding \ is itself quoted or ...'

as in those situations there is no \n escape sequence.   With \\n there
is an escape sequence, \\ which produces a literal \ in the output, and
there is a plain ordinary n.   in [\n] there is no escape sequence at all,
as there's no escape character there.

That \ happens to look like the escape character,, in situations where it
isn't, is immaterial, either we have an escape char, or a backslash, they
aren't the same thing, whatever they look like. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2022-01-18 01:07 calestyo       New Issue                                    
2022-01-18 01:07 calestyo       Name                      => Christoph Anton
Mitterer
2022-01-18 01:07 calestyo       Section                   => Utilities, sed /
9.3.5 RE Bracket Expression
2022-01-18 01:07 calestyo       Page Number               => -               
2022-01-18 01:07 calestyo       Line Number               => -               
2022-01-18 09:41 geoffclare     Note Added: 0005621                          
2022-01-18 13:26 calestyo       Note Added: 0005622                          
2022-01-18 16:30 kre            Note Added: 0005623                          
======================================================================


  • [Issue 8 dra... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
      • Re:... Christoph Anton Mitterer via austin-group-l at The Open Group
        • ... Geoff Clare via austin-group-l at The Open Group
          • ... Christoph Anton Mitterer via austin-group-l at The Open Group
            • ... Geoff Clare via austin-group-l at The Open Group

Reply via email to