On Thu, 2011-06-16 at 14:27 -0400, Rich Felker wrote:
> On Thu, Jun 16, 2011 at 11:07:55AM -0700, Cathey, Jim wrote:
> > >Actually, xargs (the standard one, without -0) accepts a shell-quoted
> > >list of filenames, so rather than -print0, find could have just been
> >
> > Maybe now they do, but when they were first written
> > they did not. (Or so I understand.)
>
> Are you sure? As far as I know xargs has always behaved this way. It
> would have been completely incompatible to make this change
> retroactively if xargs had not originally behaved that way. In
> particular, non-quoted whitespace (including spaces) is treated by
> xargs as a delimiter - adding that behavior would have broken
> everything using xargs if it weren't already behaving that way.
I checked and POSIX xargs must support quoting rules on its input, as
far back as I can see. So it's likely it's always behaved this way.
However, be aware that the POSIX requirement for quoting of xargs input
is not identical to the shell's quoting rules (the standard calls this
out specifically). It's certainly possible for find to generate
appropriately quoted output that would work with both the shell and
xargs, though.
find -printq anyone?
PS. Interestingly, there's a move afoot to remove newline from the set
of acceptable characters in a POSIX-compliant filename...
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox