bug-findutils
[Top][All Lists]
Advanced

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

[bug #44570] Wrong find -type f -not -name "*txt" result for files with


From: Eric Blake
Subject: [bug #44570] Wrong find -type f -not -name "*txt" result for files with weird names
Date: Wed, 18 Mar 2015 15:08:00 +0000
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

Follow-up Comment #1, bug #44570 (project findutils):

Try again, using: LC_ALL=C find -type f -not -name '*.txt'

My guess is that you are in a non-C multibyte locale, and that the filenames
being printed are ones that are invalid when interpreted in the multibyte
encoding rules of your current locale.  globbing is only required to work on
valid encoded content, so the fact that you have a name that is not a valid
encoding means that the glob cannot match it, and therefore it gets printed
even though it ends in a .txt ending.  Switching to a locale where there are
no encoding errors (such as LC_ALL=C) will avoid the problem.

Oh, and don't use: -name *.txt.  You WANT to use -name '*.txt' (so that the
shell is not expanding the glob prior to calling find, but rather that find is
being given a literal glob to expand itself).

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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