Hey,
A statement in the find(1) man page and a source comment in find.c are
outdated and incorrect.
The man page didn't mention that using -delete or -execdir prevents
-print from being assumed.
Similarly for a comment in find.c, but this didn't mention -delete,
-execdir, -ls or -print0.
(These primaries can be tested and/or you can see where isoutput is set
to 1 in function.c.)
I have a patch below to correct these.
Cheers,
Kris Katterjohn
Index: find.1
===================================================================
RCS file: /cvs/src/usr.bin/find/find.1,v
retrieving revision 1.93
diff -u -p -r1.93 find.1
--- find.1 3 Jan 2017 22:19:31 -0000 1.93
+++ find.1 30 Jul 2018 21:28:36 -0000
@@ -60,7 +60,9 @@ In the absence of an expression,
is assumed.
If an expression is given,
but none of the primaries
+.Ic -delete ,
.Ic -exec ,
+.Ic -execdir ,
.Ic -ls ,
.Ic -ok ,
.Ic -print ,
Index: find.c
===================================================================
RCS file: /cvs/src/usr.bin/find/find.c,v
retrieving revision 1.22
diff -u -p -r1.22 find.c
--- find.c 4 Jan 2017 09:21:26 -0000 1.22
+++ find.c 30 Jul 2018 21:28:36 -0000
@@ -86,9 +86,10 @@ find_formplan(char **argv)
}
/*
- * if the user didn't specify one of -print, -ok or -exec, then -print
- * is assumed so we bracket the current expression with parens, if
- * necessary, and add a -print node on the end.
+ * if the user didn't specify one of -delete, -exec, -execdir,
+ * -ls, -ok, -print or -print0, then -print is assumed so we
+ * bracket the current expression with parens, if necessary,
+ * and add a -print node on the end.
*/
if (!isoutput) {
if (plan == NULL) {