暗无天日

=============>DarkSun的个人博客

不死的sed

真的从来没想到到现在 sed 居然还在更新中...

2018年12月19日,sed更新了4.6版...

* Noteworthy changes in release 4.6 (2018-12-19) [stable]

** Improvements

  sed now prints a clear error message when r/R/w/W (and s///w) commands
  are missing a filename. Previously, w/W commands would fail with confusing
  error message, while r/R would be a silent no-op.

  sed now uses fully-buffered output (instead of line-buffered) when
  writing to files. This should noticeably improve performance of "sed -i"
  and other write commands.
  Buffering can be disabled (as before) with "sed -u".

  sed in non-cygwin windows environments (e.g. mingw) now properly handles
  '\n' newlines in -b/--binary mode.

** Bug fixes

  sed no longer accesses invalid memory (heap overflow) when given invalid
  backreferences in 's' command [bug#32082, present at least since sed-4.0.6].

  sed no longer adds extraneous NUL when given s/$//n command.
  [related to bug#32271, present since sed-4.0.7]

  sed no longer accesses invalid memory (heap overflow) with s/$//n regexes.
  [bug#32271, present since sed-4.3].

** New Features

  New option, --debug: print the input sed script in canonical form
  and annotate program execution.

这次升级最大的改动应该就是添加了一个 --debug 选项方便进行调试。

同时将原来的 行缓存 方式修改成 全缓存 方式,以显著提高写入文件的速度。

另外错误信息也调整的更加清晰了一些。