On 04/13/2016 03:07 PM, Kamil Dudka wrote: > * find(-exec): Explain how exit status is propagated if the > -exec command {} + syntax is used. > > Reported at https://bugzilla.redhat.com/1325049
Thanks for the report and the patch. I thought this was already documented somewhere, but obviously not in the man page (probably in the Texinfo manual). > --- > find/find.1 | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/find/find.1 b/find/find.1 > index c948b4b..2c228f8 100644 > --- a/find/find.1 > +++ b/find/find.1 > @@ -1066,22 +1066,25 @@ option instead. > .IP "\-exec \fIcommand\fR {} +" > This variant of the > .B \-exec > action runs the specified command on the > selected files, but the command line is built by appending each > selected file name at the end; the total number of invocations of the > command will be much less than the number of matched files. The > command line is built in much the same way that > .B xargs > builds its command lines. Only one instance of `{}' is allowed within > the command. The command is executed in the starting directory. If > +any invocation returns a non-zero value as exit status, the s/the$/then/ > +.B find > +utility returns a non-zero exit status. If > .B find > encounters an error, this can sometimes cause an > immediate exit, so some pending commands may not be run > at all. This variant of > .B \-exec > always returns true. > > .IP "\-execdir \fIcommand\fR ;" > .IP "\-execdir \fIcommand\fR {} +" > Like > .BR \-exec , > The same applies to -execdir (which should be preferred anyway). I've added that in the attached, and adjusted the commit message to GNU standards. I'll push that in your name soon. Thanks & have a nice day, Berny
>From 04acdcac0cbeeea4f38a6450b151cd3e750253a8 Mon Sep 17 00:00:00 2001 From: Kamil Dudka <kdu...@redhat.com> Date: Sun, 17 Apr 2016 22:36:13 +0200 Subject: [PATCH] doc: clarify exit status handling of -exec command {} + * find/find.1 (-exec): Explain how exit status is propagated if the -exec command {} + syntax is used. (-execdir): Likewise. Reported at https://bugzilla.redhat.com/1325049 --- find/find.1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/find/find.1 b/find/find.1 index 7b626b5..8958085 100644 --- a/find/find.1 +++ b/find/find.1 @@ -1077,6 +1077,9 @@ command line is built in much the same way that .B xargs builds its command lines. Only one instance of `{}' is allowed within the command. The command is executed in the starting directory. If +any invocation returns a non-zero value as exit status, then +.B find +returns a non-zero exit status. If .B find encounters an error, this can sometimes cause an immediate exit, so some pending commands may not be run @@ -1112,6 +1115,9 @@ appropriately-named file in a directory in which you will run The same applies to having entries in .B $PATH which are empty or which are not absolute directory names. If +any invocation returns a non-zero value as exit status, then +.B find +returns a non-zero exit status. If .B find encounters an error, this can sometimes cause an immediate exit, so some pending commands may not be run -- 2.1.4