Austin Group Defect Tracker

Aardvark Mark III

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001231 [1003.1(2016)/Issue7+TC2] Shell and Utilities Objection Enhancement Request 2019-03-01 09:50 2019-03-01 09:50
Reporter stephane View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name St├ęphane Chazelas
User Reference
Section sed utility
Page Number 3218
Line Number 107963-107965
Interp Status ---
Final Accepted Text
Summary 0001231: backslash processing in text arguments
Description > The argument text shall consist of one or more lines.
> Each embedded <newline> in the text shall be preceded by
> a <backslash>. Other <backslash> characters in text shall
> be removed, and the following character shall be treated
> literally.

That means

sed 'a\

for instance is *required* to output


at the end of the cycle.

That's not what several implementations including GNU and
busybox do even with POSIXLY_CORRECT in the environment, which
expand that \t to a TAB character.

That requirement is not useful and I don't expect any
application would rely on the POSIX-mandated behaviour.

There are also some variation in behaviour in:

sed 'a\

There are also some sed implementations (traditional ones like
on Solaris) that don't treat:

sed -e 'a\' -e 'text'

the same as

sed 'a\

(same for sed -f a -f b, where a and b contain those two
Desired Action
Change the text above to:

> The argument text shall consist of one or more lines.
> Each embedded <newline> (other than the one for the last line
> of the text) in the text shall be preceded by a <backslash>.
> <backslash> may itself be escaped with another <backslash>,
> the behaviour is unspecified if an unescaped <backslash> is
> immediately followed by any other character or the end of a
> sed script or script_file (including if it's the last
> character of the last line of a script_file).

Though the part about \ at the end of script or script_files
should probably be addressed elsewhere as it affects other
commands than those that take those "text argument"s.

You may also want to clarify how backslash (including
<backslash><newline>) is meant to be handled in rfile, wfile
arguments as part of that same bug.
Tags No tags attached.
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-03-01 09:50 stephane New Issue
2019-03-01 09:50 stephane Name => St├ęphane Chazelas
2019-03-01 09:50 stephane Section => sed utility
2019-03-01 09:50 stephane Page Number => 3218
2019-03-01 09:50 stephane Line Number => 107963-107965

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