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

Submitter:  Aleks M. <aleksm>
Submitted:  Wed 10 Apr 2013 04:11:32 AM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  4.4.2 Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

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,
section REDIRECTION:

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

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,
Berny

Bernhard Voelker <berny>
Group administrator
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,
Aleksandr.


Aleks M. <aleksm>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-10 ericb StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code