[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] clarify exit status handling of -exec command {} +

From: Bernhard Voelker
Subject: Re: [PATCH] clarify exit status handling of -exec command {} +
Date: Sun, 17 Apr 2016 22:46:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

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


> +.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,

Attachment: 0001-doc-clarify-exit-status-handling-of-exec-command.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]