From: Pádraig Brady Date: Mon, 1 Dec 2008 10:41:50 +0000 (+0000) Subject: doc: Make descriptions of ASCII NUL and --zero-terminated option consistent X-Git-Tag: v7.1~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa2617b9086ca7ffaf49fd22c0b54ab58c2107fd;p=platform%2Fupstream%2Fcoreutils.git doc: Make descriptions of ASCII NUL and --zero-terminated option consistent doc/coretuils.texi: Refactor shuf, sort and uniq --zero-terminated option to use the same text. Also refer to NUL characters as @acronym{ASCII} @sc{nul} consistently. --- diff --git a/doc/coreutils.texi b/doc/coreutils.texi index e331168..983a694 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -1835,7 +1835,7 @@ Output at most @var{bytes} bytes of the input. Prefixes and suffixes on @cindex string constants, outputting Instead of the normal output, output only @dfn{string constants}: at least @var{bytes} consecutive @acronym{ASCII} graphic characters, -followed by a null (zero) byte. +followed by a zero byte (@acronym{ASCII} @sc{nul}). Prefixes and suffixes on @code{bytes} are interpreted as for the @option{-j} option. @@ -1874,7 +1874,7 @@ hexadecimal @end table The type @code{a} outputs things like @samp{sp} for space, @samp{nl} for -newline, and @samp{nul} for a null (zero) byte. Only the least significant +newline, and @samp{nul} for a zero byte. Only the least significant seven bits of each byte is used; the high-order bit is ignored. Type @code{c} outputs @samp{ }, @samp{\n}, and @code{\0}, respectively. @@ -3267,16 +3267,17 @@ Print only the maximum line lengths. @c texi2dvi (GNU Texinfo 4.11) 1.104 @c @cindex including files from @command{\cmd\} Disallow processing files named on the command line, and instead process -those named in file @var{file}; each name being terminated by a @sc{nul} byte. +those named in file @var{file}; each name being terminated by a zero byte +(@acronym{ASCII} @sc{nul}). This is useful \withTotalOption\ when the list of file names is so long that it may exceed a command line length limitation. In such cases, running @command{\cmd\} via @command{xargs} is undesirable because it splits the list into pieces and makes @command{\cmd\} print \subListOutput\ for each sublist rather than for the entire list. -One way to produce a list of @sc{nul} terminated file names is with @sc{gnu} +One way to produce a list of @acronym{ASCII} @sc{nul} terminated file names is with @sc{gnu} @command{find}, using its @option{-print0} predicate. -If @var{file} is @samp{-} then the @sc{nul} terminated file names +If @var{file} is @samp{-} then the @acronym{ASCII} @sc{nul} terminated file names are read from standard input. @end macro @filesZeroFromOption{wc,,a total} @@ -4003,9 +4004,8 @@ However, fields that extend to the end of the line, as @option{-k 2}, or fields consisting of a range, as @option{-k 2,3}, retain the field separators present between the endpoints of the range. -To specify a null character (@acronym{ASCII} @sc{nul}) as -the field separator, use the two-character string @samp{\0}, e.g., -@samp{sort -t '\0'}. +To specify @acronym{ASCII} @sc{nul} as the field separator, +use the two-character string @samp{\0}, e.g., @samp{sort -t '\0'}. @item -T @var{tempdir} @itemx --temporary-directory=@var{tempdir} @@ -4038,18 +4038,21 @@ For example, @code{sort -n -u} inspects only the value of the initial numeric string when checking for uniqueness, whereas @code{sort -n | uniq} inspects the entire line. @xref{uniq invocation}. +@macro zeroTerminatedOption @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}). +@cindex process zero-terminated items +Delimit items with a zero byte rather than a newline (@acronym{ASCII} @sc{lf}). +I.E. treat input as items separated by @acronym{ASCII} @sc{nul} +and terminate output items with @acronym{ASCII} @sc{nul}. This option can be useful in conjunction with @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 macro +@zeroTerminatedOption @end table @@ -4297,18 +4300,7 @@ commands like @code{shuf -o F