NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/59639: sed(1) man page is wrong about case-insensitivity flag



>Number:         59639
>Category:       bin
>Synopsis:       sed(1) man page is wrong about case-insensitivity flag
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 07 18:55:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        9
>Organization:
thE netBSeD fOuNDAtIoN
>Environment:
>Description:

	The sed man page says:

>   Sed Addresses
>     An address is not required, but if specified must have one of the
>     following formats:
> ...
>           o   a context address that consists of a regular expression
>               preceded and followed by a delimiter.  The closing delimiter
>               can also optionally be followed by the "i" character, to
>               indicate that the regular expression is to be matched in a
>               case-insensitive way.

	But:

	$ echo foo | sed -e /foo/d
	$ echo Foo | sed -e /foo/d
	Foo
	$ echo Foo | sed -e /foo/id
	sed: 1: "/foo/id
	": command i expects \ followed by text
	$ echo Foo | sed -e /foo/di
	sed: 1: "/foo/di
	": extra characters at the end of d command

	It turns out the flag is I (uppercase), not i (lowercase):

	$ echo Foo | sed -e /foo/Id
	$ { echo Foo; echo bar; } | sed -e /foo/Id
	bar


>How-To-Repeat:

	As shown above.


>Fix:

	Yes, please!




Home | Main Index | Thread Index | Old Index