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.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to