|Anonymous | Login||2018-12-12 11:49 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Type||Date Submitted||Last Update|
|0001204||[1003.1(2016)/Issue7+TC2] Shell and Utilities||Objection||Clarification Requested||2018-08-31 16:22||2018-08-31 16:22|
|Final Accepted Text|
|Summary||0001204: Vague wording as to the validity of s/RE command without trailing delimiter and replacement|
The s (Substitute) command has the following format:
Under the heading "Commands in ed", the specification says:
"If the closing delimiter of an RE or of a replacement string (for example, '/' ) in a g, G, s, v, or V command would be
the last character before a <newline>, that delimiter can be omitted, in which case the addressed line shall be written.
For example, the following pairs of commands are equivalent:
The wording "the closing delimiter of an RE or of a replacement string" is vague, and can be read as either referring to both the RE and replacement fields of the s command, or just the last field (as it refers to both commands with one argument, and commands with two arguments).
The "s" example is of a command that includes both the RE and replacement, without the closing delimiter.
However, there is no example such as "s/s1" or "s/s1/".
It is not specified in the text if "s/s1" is a valid commands, or how should they behave - specifically, what should be the value of the replacement string.
In contrast, the specification for the ex utility clearly allows "s/s1", and describe how it should be handled:
(quote from the "Substitute" section)
"The trailing delimiter can be omitted from pattern or from repl at the end of the command line. [...]
If only repl is not specified or is empty, the pattern shall be replaced by nothing."
Of the various ed implementation I surveyed, all of them allow for "s/s1", with the replacement string being empty.
One exception is GNU ed, which in the recent release 1.14.2 has decided that "s/s1" is invalid.
See https://lists.gnu.org/archive/html/bug-ed/2017-10/msg00003.html [^]
|Desired Action||Clarify whether the partial command "s/s1" is valid, and how it should be interpreted.|
|Tags||No tags attached.|
|There are no notes attached to this issue.|
|2018-08-31 16:22||salty-horse||New Issue|
|2018-08-31 16:22||salty-horse||Name||=> Ori Avtalion|
|2018-08-31 16:22||salty-horse||Section||=> ed|
|2018-08-31 16:22||salty-horse||Page Number||=> 0|
|2018-08-31 16:22||salty-horse||Line Number||=> 0|
|2018-09-16 22:19||Antonio Diaz||Issue Monitored: Antonio Diaz|
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|