diff options
author | James Youngman <jay@gnu.org> | 2007-05-13 11:02:43 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-05-13 11:02:43 +0200 |
commit | e06252480ac023b8c5f03ee1a8ab43d386fefd46 (patch) | |
tree | b1b30dbb3a8f0b20e75548af3972fc141e6f56b6 /doc | |
parent | cdd66362dc88370c1372f76a5573cb486d1c23c9 (diff) | |
download | coreutils-e06252480ac023b8c5f03ee1a8ab43d386fefd46.tar.xz |
Add -z option to uniq. Originally proposed by Egmont Koblinger.
* NEWS: Mention uniq's new option: --zero-terminated (-z).
* src/uniq.c: Add new option, --zero-terminated (-z), to make
uniq use the NUL byte as separator/delimiter rather than newline.
(check_file): Add a parameter: delimiter. Update caller.
Use readlinebuffer_delim in place of readlinebuffer everywhere.
(main): Handle the new option.
(usage): Describe new option the same way sort does.
* doc/coreutils.texi (uniq invocation): Describe the new option.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coreutils.texi | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 6fc72ec2f..cc4d0b853 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -4229,11 +4229,15 @@ This is equivalent to @option{--all-repeated} (@option{-D}). @item prepend Output a newline before each group of repeated lines. +With @option{--zero-terminated} (@option{-z}), use +an @acronym{ASCII} @sc{nul} (zero) byte instead of a newline. @item separate Separate groups of repeated lines with a single newline. +With @option{--zero-terminated} (@option{-z}), use +an @acronym{ASCII} @sc{nul} (zero) byte instead of a newline. This is the same as using @samp{prepend}, except that -there is no newline before the first group, and hence +no delimiter is inserted before the first group, and hence may be better suited for output direct to users. @end table @@ -4261,6 +4265,19 @@ Compare at most @var{n} characters on each line (after skipping any specified fields and characters). By default the entire rest of the lines are compared. +@item -z +@itemx --zero-terminated +@opindex -z +@opindex --zero-terminated +@cindex sort zero-terminated lines +Treat the input as a set of lines, each terminated by a null character +(@acronym{ASCII} @sc{nul}) instead of a line feed +(@acronym{ASCII} @sc{lf}). +This option can be useful in conjunction with @samp{sort -z}, @samp{perl -0} or +@samp{find -print0} and @samp{xargs -0} which do the same in order to +reliably handle arbitrary file names (even those containing blanks +or other special characters). + @end table @exitstatus |