[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inconsistent behavior of sort -z
From: |
Philip Rowlands |
Subject: |
Re: inconsistent behavior of sort -z |
Date: |
Thu, 15 Nov 2007 18:04:08 +0000 (GMT) |
On Thu, 15 Nov 2007, Stanislav Brabec wrote:
Comparing coreutins with busybox I found following inconsistency in
the GNU coreutils:
GNU sort -z documents:
use NUL instead of EOL on input
Right, more specifically:
"Treat the input as a set of lines, each terminated by a null character
(ASCII NUL) instead of a line feed (ASCII LF)."
GNU sort -z does:
use NUL instead of EOL on input and output
Does this not follow as a corollary of the documentation? The way I read
it, -z tells sort to "use NUL instead of LF".
Do you see the NUL/LF as a separator or end-marker? In other words,
isn't the terminating character part of the line, to be carried through
and printed to the output? That's my understanding, and considering the
practical implications, if the user had a genuine need for
NUL-terminated lines (awkward filenames, etc), surely the output must be
similarly NUL-terminated, otherwise the concept of a "line" becomes
confused.
Note that implementing it as documented would break GNU findutils
updatedb, as happens with busybox.
Agreed, busybox appears to handle -z differently.
Cheers,
Phil