'sed -iE' is not the same as 'sed -Ei'. 'sed -ni' is dangerous.
From https://bugs.debian.org/832088
* doc/sed.texi (Command-Line Options): Explain and add examples
to '-i/--in-place' item.
Regex addresses work on current pattern space, not on the original
input lines. From https://bugs.debian.org/284646
* doc/sed.texi (Regexp Addresses): Add a paragraph and an example.
* doc/sed.x (Addresses): Add a sentence about regexp.
Unescaping takes place before passing the pattern to the regex engine:
$ echo 'a^c' | sed -e 's/\x5e/b/'
ba^c
From: https://bugs.debian.org/605142
* doc/sed.texi (Escaping Precedence): Add new subsection under 'escape
sequences' with examples.
Sample code in the basic/extended table was too wide to fit on a Letter
size printout. Text was overlapping and unreadable. Remove margin,
split commands in two lines and change the column with.
* doc/sed.texi (Basic and extended regexp): Rework table.
"Reads text file a file" was probably a typo. Also remove "Example: " in
the summary as there's no example there.
* doc/sed.texi (sed scripts): Fix r command description.
Copyright-paperwork-exempt: Yes
The samples commands demonstrating '\B' and '\S' were both using '\w'.
The commands output is correct.
* doc/sed.texi (Regular Expression Extensions): Use the proper commands.
Copyright-paperwork-exempt: Yes
Remove an extraneous space after @xref. Older 'makeinfo' would fail with:
./doc/sed.texi:3461: @xref expected braces.
./doc/sed.texi:3461: ` {Execution Cycle} and @ref{Addresses ov...' is
too long for expansion; not expanded.
Introduced in sed-4.3-15-gb0009b8.
* doc/sed.texi: Remove space after @xref.
Explain which commands can be separated by semicolon and which require
newlines. Requested by Ori Avtalion in https://bugs.gnu.org/21845 .
* doc/sed.texi (Multiple commands syntax): New section in "sed scripts"
chapter.
Remove broken link and update other resources in the manual.
Reported by olszkocj@aol.com in https://bugs.gnu.org/24770 .
* doc/sed.texi (Other Resources): Update wording.
Skip building the man page if building from tarball (where 'doc/sed.1'
is already prebuilt). Build a stub if building from git but generating
the man page isn't possible (if there's no Perl or cross-compiling).
Cross-compilation issue reported by Vishal Biswas in
https://bugs.gnu.org/25358 .
Problematic 'perl' is related to https://bugs.gnu.org/25367 .
* configure.ac: Check for Perl, cross-compilation and tarball build;
Set automake variable BUILD_MAN_PAGE, BUILD_DUMMY_MAN_PAGE accordingly.
* doc/local.mk (doc/sed.1): Build conditionally if BUILD_MAN_PAGE is true;
Create a dummy man page if BUILD_DUMMY_MAN_PAGE is true.
* doc/sed-dummy.1: Stub man page.
Do not bother autogenerating sed.texi from sed-in.texi. All it did
was to add a few '@group' commands. Since these are rarely modified,
add them manually. This simplifies the documentation-building rules
and lets us distribute only one copy of the texinfo manual.
See http://lists.gnu.org/archive/html/sed-devel/2016-12/msg00013.html
* doc/groupify.sed, doc/sed-in.texi: Remove files.
* doc/sed.texi: Remove the 'auto-generated' warning, as this file is no
longer auto-generated.
* doc/local.mk (doc_sed_TEXINFOS): Rename from sed_TEXINFOS.
(dist_noinst_DATA): The above renaming enables us to remove
doc/config.texi and doc/fdl.texi from this list.
(dist_noinst_SCRIPTS): Remove.
(doc/sed.texi): Remove rule.
(doc/s-texi): Likewise.
Fixes few missing issues from commit v4.2.2-176-g801a2c8,
discussed in
http://lists.gnu.org/archive/html/sed-devel/2016-12/msg00005.html
* doc/config.texi: Add stub texinfo macros '@codequotebacktick' and
'@codequoteundirected' (needed if using older versions of texinfo).
* doc/sed-in.texi: Fix syntax that's accepted by newer texinfo but
rejected by texinfo-4.13; Disable directed quote characters in examples.
* doc/sed.texi: Auto-regenerated.
* bootstrap.conf: Add gnulib's fdl module.
* doc/sed-in.texi: Update license blurb to latest recommended text.
Remove duplicated copyright information from title page (copied from
coreutil's texinfo style). Include fdl.texi in a new appendix.
Regenerate sed.texi from sed-in.texi after
doc change in v4.2.2-160-10549b7 ( https://bugs.gnu.org/24799 ).
* doc/sed.texi: Regenerated with 'make info'.
In sandbox mode, r/w/e commands are not allowed.
This ensures sed operates only on files designated on the command line,
and cannot execute external programs.
* sed/sed.c (sandbox): New option variable.
(usage): List new option.
(main): Accept new option in getopt.
* sed/sed.h (sandbox): New extern option variable.
* sed/compile.c (DISALLOWED_CMD): New error message.
(read_filename): Abort in sandbox mode (r/w commands).
(compile_program): Abort on 'e' in sandbox mode.
* testsuite/sandbox.sh: Test new option.
* testsuite/local.mk: Add new test.
* NEWS: Mention new option.
* doc/sed-in.texi, doc/sed.texi: Document new option.
* doc/local.mk (distclean-local): Remove rule. Moved to ...
* Makefile.am (distclean-local): ...here, and add a command to
remove all .deps directories. It could have stayed in that .mk
file, but since with this change, it is no longer specific to doc/,
the top level makes more sense.
* lib/local.mk (MOSTLYCLEANFILES): Remove this. Covered by the above.
Reported by Assaf Gordon in
https://lists.gnu.org/archive/html/sed-devel/2016-08/msg00019.html
* doc/local.mk (doc/sed.1): Depend not on sed.c, but on the binary
that help2man must run. Also depend on .version, to be sure we
pick up a version change. Also, be careful not to write directly
to $@: instead write to $@-t, and make read-only to mark as generated,
and then, only if all is well, rename atomically to $@.
Also, prefix commands with $(AM_V_GEN) and $(AM_V_at) and ensure
that doc/ exists via $(MKDIR_P).
(distclean-local): New target. Use this instead of ...
(dist-hook-man-page): ... this. Remove rule.
(SEDBIN): Remove unnecessary $(top_builddir)/ prefix.
(doc/sed.texi, doc/s-texi): Remove some uses of $(top_builddir).
Replace others with $(srcdir).
* Makefile (dist-hook): remove dependency on dist-hook-man-page.
* lib/local.mk (MOSTLYCLEANFILES): Arrange for lib/.deps/*.Po
to be removed as part of "make distclean", so that make distcheck
no longer fails when using latest automake.
* .gitignore: Ignore '.dirstamp' files
* bootstrap.conf: Add 'non-recursive-gnulib-prefix-hack' gnulib module.
Add missing 'stdalign' module.
(bootstrap_post_import_hook): Use module to adjust gnulib.mk file.
* configure.ac: Add 'subdir-objects' automake option, don't generate
makefiles in subdirectories. Adjust path of XFAIL tests.
* Makefile.am: Include 'local.mk' files, adjust for non-recursive make.
* doc/Makefile.am: Rename to ...
* doc/local.mk: Adjust paths. Rename SED to
SEDBIN variable, to avoid overriding the default system-wide SED value
which is automatically set by autotools.
* lib/Makefile.am: Rename to ...
* lib/local.mk: Adjust paths.
* lib/.gitignore: Ignore 'stdalign.h' from gnulib module.
* sed/Makefile.am: Rename to ...
* sed/local.mk: Adjust paths.
* testsuite/Makefile.am: Rename to ...
* testsuite/local.mk: Adjust paths.
* testsuite/init.cfg: Move to ...
* init.cfg: ... here. Moved to avoid changing the path in init.sh, and to
keep the same directory structure as coreutils.
(require_en_utf8_locale_): Adjust path for get-mb-cur-max executable.
(require_ja_shiftjis_locale_,require_valid_ja_shiftjis_locale_): Adjust
path for test-mbrtowc executable.
* m4/.gitignore: Add gnulib's non-recusive-make module.
* testsuite/runtest: Adjust paths of Makefile.tests and dir variables,
Skip utility program 'get-mb-cur-max' which is not a standalone test.
* testsuite/Makefile.tests: Adjust path of sed exeutable.
* testsuite/eval.sed, testsuite/eval.good: Adjust path of sed executable.
* testsuite/cmd-R.sh,
testsuite/cmd-l.sh,
testsuite/colon-with-no-label.sh,
testsuite/comment-n.sh,
testsuite/compile-errors.sh,
testsuite/compile-tests.sh,
testsuite/convert-number.sh,
testsuite/execute-tests.sh,
testsuite/follow-symlinks-stdin.sh,
testsuite/follow-symlinks.sh,
testsuite/help-version.sh,
testsuite/in-place-hyphen.sh,
testsuite/in-place-suffix-backup.sh,
testsuite/invalid-mb-seq-UMR.sh,
testsuite/mb-bad-delim.sh,
testsuite/mb-charclass-non-utf8.sh,
testsuite/mb-match-slash.sh,
testsuite/mb-y-translate.sh,
testsuite/normalize-text.sh,
testsuite/nulldata.sh,
testsuite/panic-tests.sh,
testsuite/posix-char-class.sh,
testsuite/posix-mode-N.sh,
testsuite/posix-mode-addr.sh,
testsuite/posix-mode-bad-ref.sh,
testsuite/posix-mode-s.sh,
testsuite/range-overlap.sh,
testsuite/recursive-escape-c.sh,
testsuite/regex-errors.sh,
testsuite/stdin-prog.sh,
testsuite/subst-mb-incomplete.sh,
testsuite/subst-options.sh,
testsuite/subst-replacement.sh,
testsuite/temp-file-cleanup.sh,
testsuite/unbuffered.sh: Adjust paths of init.sh, sed executable.
* cfg.mk (local-checks-to-skip): Remove the overall exemption,
but continue to exempt some files in testsuite/.
* configure.ac: Split a long line.
* doc/sed-in.texi: Split long lines.
* doc/sed.texi: Likewise.
* sed/compile.c: Likewise.
* sed/execute.c: Split long lines.
(execute_program): Reorder "#ifdef HAVE_POPEN" and
"if (pipe_fp != NULL)" if/else blocks to make the code
clearer and (incidentally) the lines shorter, due to a
decrease in nesting level.
* sed/sed.c: Split long lines.
* sed/utils.c: Likewise.
* sed/utils.h: Likewise.
* build-aux/texi2dvi: Remove file. It was out of date and could
no longer parse our .texi files.
* Makefile.am (EXTRA_DIST): Don't list it here.
* cfg.mk: Remove an exemption for that file.
* doc/Makefile.am (TEXI2DVI): Remove definition.
* sed/Makefile.am (sed_SOURCES): Remove fmt.c.
* sed/execute.c (execute_program):
* sed/fmt.c: Remove file.
* sed/sed.h (fmt): Remove declaration.
* doc/sed.texi: Remove documentation for 'L' command.
* doc/sed-in.texi: Likewise.
* NEWS (Feature removal): Document it.
Prompted by the report from Jodie Cunningham that using this
command with a large number could cause sed to segfault:
https://bugs.launchpad.net/ubuntu/+source/sed/+bug/1400575
First, run this command:
git grep -l ' $'|xargs perl -pi -e 's/[ \t]+$//'
Then some minor fix-up to make the two newly-failing tests
pass once again:
* testsuite/mac-mf.sed: Append this, s/ $//,
to eliminate trailing spaces in the actual output.
* testsuite/y-newline.good: Manually remove a trailing
space between two concatenated prompts.
2014-03-26 Jose E. Marchesi <jemarch@gnu.org>
* doc/sed.texi (Regular Expressions): avoid a potential
misunderstanding in the description of the \| operator.
2013-10-16 David A. Wheeler <dwheeler@dwheeler.com>
* doc/sed-in.texi: Document "-E" option to use EREs.
GNU sed already supported "-E" as an undocumented synonym
for "-r", but "-E" is now in POSIX.
See: http://austingroupbugs.net/view.php?id=528.
* doc/sed.1: Likewise.
* doc/sed.texi: Likewise.
* doc/sed.x: Likewise.
* sed/sed.c: Likewise.