On Thu, Aug 22, 2019 at 11:00:57AM -0600, Todd C. Miller wrote:
> The point of that example is to show how to safely use xargs.  Since
> find now has its own built-in xargs support perhaps we should adapt
> the example to use that instead.
As claudio and tb already pointed out, that is indeed a valid point.

> We can also list the -delete method as an alternative.  E.g.
I concur.  We can at least showcase the "batching" version that passes
multiple arguments to rm(1) while also mentioning `-delete'.

Both find(1)'s `-print0' and xarg(1)'s `-0' reference each other, I'd
say that is enough together with find(1)'s CAVEATS such that
`find -print0 | xargs -0' does not have to me shown in EXAMPLES again.

How about that?

Index: find.1
===================================================================
RCS file: /cvs/src/usr.bin/find/find.1,v
retrieving revision 1.96
diff -u -p -r1.96 find.1
--- find.1      6 Dec 2018 17:45:14 -0000       1.96
+++ find.1      22 Aug 2019 17:16:32 -0000
@@ -581,9 +581,9 @@ ending in a dot and single digit, but sk
 Find and remove all *.jpg and *.gif files under the current working
 directory:
 .Pp
-.Dl "$ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} \e;"
+.Dl "$ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} +"
 or
-.Dl "$ find . \e( -name \e*.jpg -o -name \e*.gif \e) -print0 | xargs -0r rm"
+.Dl "$ find . \e( -name \e*.jpg -o -name \e*.gif \e) -delete"
 .Sh SEE ALSO
 .Xr chflags 1 ,
 .Xr chmod 1 ,

Reply via email to