Subject: bin/26255: usage fixes for sed(1)
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <hira@po6.nsk.ne.jp>
List: netbsd-bugs
Date: 07/12/2004 12:01:12
>Number: 26255
>Category: bin
>Synopsis: usage fixes for sed(1)
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Mon Jul 12 03:04:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Kouichirou Hiratsuka
>Release: NetBSD 2.0G
>Organization:
>Environment:
System: NetBSD firefly.localdomain 2.0G NetBSD 2.0G (FIREFLY.MP) #21: Sat Jul 10 21:10:28 JST 2004 root@firefly.localdomain:/usr/src/sys/arch/i386/compile/FIREFLY.MP i386
Architecture: i386
Machine: i386
>Description:
The usage of sed(1) has following problems.
* `script' should be located after options (1st line)
* -E is missing (2nd line)
>How-To-Repeat:
see usage
>Fix:
* relocate `script'
* add -E
* sort options
Index: sed/main.c
===================================================================
RCS file: /cvs/cvsroot/src/usr.bin/sed/main.c,v
retrieving revision 1.15
diff -u -r1.15 main.c
--- sed/main.c 16 Oct 2003 12:11:12 -0000 1.15
+++ sed/main.c 11 Jul 2004 22:42:11 -0000
@@ -168,7 +168,7 @@
default:
case '?':
(void)fprintf(stderr,
-"usage:\t%s script [-anE] [file ...]\n\t%s [-an] [-e script] ... [-f script_file] ... [file ...]\n",
+"usage:\t%s [-aEn] script [file ...]\n\t%s [-aEn] [-e script] ... [-f script_file] ... [file ...]\n",
getprogname(), getprogname());
exit(1);
}
Index: sed/sed.1
===================================================================
RCS file: /cvs/cvsroot/src/usr.bin/sed/sed.1,v
retrieving revision 1.23
diff -u -r1.23 sed.1
--- sed/sed.1 4 Jan 2004 02:24:32 -0000 1.23
+++ sed/sed.1 11 Jul 2004 23:07:52 -0000
@@ -40,11 +40,11 @@
.Nd stream editor
.Sh SYNOPSIS
.Nm
-.Op Fl anE
+.Op Fl aEn
.Ar command
.Op Ar file ...
.Nm
-.Op Fl anE
+.Op Fl aEn
.Op Fl e Ar command
.Op Fl f Ar command_file
.Op Ar file ...
@@ -79,6 +79,15 @@
to delay opening each file until a command containing the related
.Dq w
function is applied to a line of input.
+.It Fl E
+Enables the use of extended regular expressions instead of the
+usual basic regular expression syntax.
+.It Fl n
+By default, each line of input is echoed to the standard output after
+all of the commands have been applied to it.
+The
+.Fl n
+option suppresses this behavior.
.It Fl e Ar command
Append the editing commands specified by the
.Ar command
@@ -89,15 +98,6 @@
.Ar command_file
to the list of commands.
The editing commands should each be listed on a separate line.
-.It Fl n
-By default, each line of input is echoed to the standard output after
-all of the commands have been applied to it.
-The
-.Fl n
-option suppresses this behavior.
-.It Fl E
-Enables the use of extended regular expressions instead of the
-usual basic regular expression syntax.
.El
.Pp
The form of a
>Release-Note:
>Audit-Trail:
>Unformatted: