|
From: | The Wanderer |
Subject: | Re: Feature request for cut and/or sort |
Date: | Mon, 23 Jul 2007 19:02:40 -0400 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 |
Bob Proulx wrote:
Matthew Woehlke wrote:The Wanderer wrote:However, it also had the side effect of producing null-terminated lines, such that xargs could parse it cleanly even if the input contained spaces. Without the ability to produce null-terminated input segments, xargs will not work on most datasets.Maybe this helps? <...> | tr '\n' '\0' | xargs -0 <...>Isn't that the same as using xargs without the -0 option? ;-) <...> | xargs <...> The problem is the same as always, filenames with embedded newlines in them.
I've never seen a filename with an embedded newline, and AFAICT standard command-line tools cannot produce such. I was thinking of whitespace separation, not newline separation, because quite often the input does not contain escape sequences for non-separator whitespace and I've never even tried to work out a way to reliably add them in the middle of a pipeline. For data which contains whitespace but is newline-separated, the suggested pipeline does seem like it would work. I appreciate the suggestion. -- The Wanderer Warning: Simply because I argue an issue does not mean I agree with any side of it. Secrecy is the beginning of tyranny.
[Prev in Thread] | Current Thread | [Next in Thread] |