bug-findutils
[Top][All Lists]
Advanced

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

[bug #50780] -type option after printf is ignored


From: Eric Blake
Subject: [bug #50780] -type option after printf is ignored
Date: Mon, 10 Apr 2017 14:01:25 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Update of bug #50780 (project findutils):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

And that behavior of -printf is expected.  It is comparable to the POSIX
behavior of -print.

The '-printf' expression (like POSIX -print) will print the file name being
visited, then return true.

The '-type f' expression will check whether the file being visited as a
regular file, and return true or false accordingly.

When two expressions are written as 'A B', find behaves if you had instead
written 'A -a B'.  The -a operator is short-circuiting: if expression A
returns false, expression B is not attempted; but if expression A returns
true, then expression B is used.

When you write -printf first, it always executes (everything gets printed),
then you filter out the files, but do nothing further with the files you
filtered.

When you write -printf second, it only executes on the files that got past the
-type filter.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50780>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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