Anonymous | Login | 2024-12-12 17:20 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0001767 | [1003.1(2016/18)/Issue7+TC2] Shell and Utilities | Editorial | Clarification Requested | 2023-07-18 17:45 | 2024-06-11 09:07 | ||
Reporter | mohd_akram | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted | ||||
Status | Closed | ||||||
Name | Mohamed Akram | ||||||
Organization | |||||||
User Reference | |||||||
Section | sed | ||||||
Page Number | 3219 | ||||||
Line Number | 108018 | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0001767: sed: clarify behavior of c (change) command | ||||||
Description |
There's some confusion about the behavior of the sed c (change) command. Most implementations interpret it as starting the next cycle on every line that its address range matches. Meaning, any command after it in the script is not processed. Others interpret "start the next cycle" as only occurring at the end of the address range i.e. that commands following the change command are processed except on the last line of the address range. The implementations that implement the former behavior are: - GNU sed - NetBSD sed - Busybox sed - Plan 9 sed Those that don't are: - FreeBSD sed - OpenBSD sed This has been acknowledged as a bug in FreeBSD. This was previously corrected in NetBSD with the following explanation, referencing the V7 man page: sed(1) "c" command is in some sense a shorthand for "i"+"d", so, like "d" it should start the next cycle. This is explicitly documented in v7 man page: Delete the pattern space. With 0 or 1 address or at the end of a 2-address range, place text on the output. Start the next cycle. NetBSD commit: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45981 [^] FreeBSD bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271817 [^] |
||||||
Desired Action |
Change: Delete the pattern space. With a 0 or 1 address or at the end of a 2-address range, place text on the output and start the next cycle. To: Delete the pattern space. With a 0 or 1 address or at the end of a 2-address range, place text on the output. Start the next cycle. |
||||||
Tags | applied_after_i8d3, issue8 | ||||||
Attached Files | |||||||
|
Notes | |
(0006405) shware_systems (reporter) 2023-07-27 15:42 |
Ed Note: The word "text" in the Desired Action is intended to stay italicized. |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |