bugfindutils - Bugs: bug #38696, -exec didn't print error message...


bug #38696: -exec didn't print error message if no ';' delimiter found and redirection used

Submitted by:  Aleks M. <aleksm>
Submitted on:  Wed 10 Apr 2013 04:11:32 AM UTC  
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.4.2Fixed Release: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Wed 10 Apr 2013 08:27:12 AM UTC, comment #2:

Thanks for clear explanation Berny!
Now command behavior is clear for me.

Best regards,

Aleks M. <aleksm>
Wed 10 Apr 2013 07:01:45 AM UTC, comment #1:

That is not a bug in find, but rather a misunderstanding on
your side of how the shell handles redirections, e.g. man bash,

"The following redirection operators may precede or
appear anywhere within a simple command or may follow a

I.e., the following commands are identical:

$ find . -exec echo test > somefile \;
$ find . -exec echo test \; > somefile
$ > somefile find . -exec echo test \;

In all of the above cases, find will see the same arguments
while stdout is redirected to 'somefile'.

It is just common habit to place redirections at the end of
the command line.

Have a nice day,

Bernhard Voelker <berny>
Project Member
Wed 10 Apr 2013 04:11:32 AM UTC, original submission:

Behavior of two following commands differs:

find . -exec echo test
Prints error:
find: missing argument to `-exec'

find . -exec echo test > somefile \;
Prints no error messages, executes echo command and redirects whole find output to somefile. But according to manpage:
"All following arguments to find are taken to be arguments to the command until an argument consisting of `;' is encountered."

In second command ';' delimiter is placed after redirection and find must print same error as first command and exit (or manpage must be fixed).

Best regards,

Aleks M. <aleksm>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by ericb (Updated the item)
  • -unavailable- added by berny (Posted a comment)
  • -unavailable- added by aleksm (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 10 Apr 2013 01:00:50 PM UTCericbStatusNone=>Invalid

    Back to the top

    Powered by Savane 3.1-cleanup