Add a New Comment (Rich Markup)
Comment Type & Canned Response: None None > Multiple Canned Responses Fixed in CVS Is it reproducible? Fixed in alpha release, please test Fixed in current release
Yes, LC_ALL=C solved this problem. It is not a bug in 'find'. Thank you!
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).
When I type find -type f -not -name "*txt" or even: find -type f -not -name *txt on my data, there is a problem with some files (I attached a small subset of that data). There is a result below: kotu@..../tmp$ find -type f -not -name *.txt ./http___medjugorje_hr_/ا?%84?%86د?%88ة-ا?%84د?%88?%84?%8Aة-ا?%84أ?%88?%84?%89-?%84?%84أطباء-?%88ا?%84?%85?%85رضات-?%88ا?%84عا?%85?%84?%8A?%86-?%81?%8A-?%85جا?%84-ا?%84طب-?%81?%8A-?%85د?%8A?%88غ?%88ر?%8A?%87,4785.html.plain.txt ./http___www_abacosun_com_pl_/1085,?%93?%98?%90?%9BУР?%9E?%9D?%9E?%92?%90Я_?%9A?%98С?%9B?%9EТ?%90_наполнение_мо?%80?%89ин_и_?%81кладок_ко?%80?%80ек?%86и?%8F_?%84о?%80м?%8B_г?%83б.plain.txt ./http___lancuchy_net_/kolko-do-kluczy-10-xl.htm?st=?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%82a?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%84cuch ogniwo ?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%9Br.plain.txt ./http___lancuchy_net_/kolko-do-lancucha-10x60w-irma.htm?st=?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%82a?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%84cuch ogniwo ?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%9Br.plain.txt ./http___lancuchy_net_/lancuch-niezgrzewany-12mm-bialy.htm?st=?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%82a?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%84cuch ogniwo ?%84?%82?%82?%84?%84š?%84?%84?%84?%82?%82?%82?%82?%82?%82?%9Br.plain.txt ./http___www_bgk_com_pl_/?%9A?%80еди?%82?%8B-о?%82-?%95в?%80опей?%81кого-инве?%81?%82и?%86ионного-банка-дл?%8F-?%84инан?%81и?%80овани?%8F-?%80егионал?%8Cного-?%80азви?%82и?%8F-ru.plain.txt ./http___instar_net_pl_/Те?%80ка-дл?%8F-?%87и?%89енн?%8F-?%96-пол?%96?%80?%83ванн?%8F-ке?%80ам?%96?%87ни?%85-пли?%82ок-?%96-ви?%80?%96вн?%8Eванн?%8F-епок?%81идни?%85-?%88в?%96в.plain.txt ./http___www_bonuseurotech_com_pl_/?%9B?????%82?%8B-?????%8F-????????????????-?????%88??????-??-???????????%80?%82????,29.html?&bViewAll=true&bViewAll=true&bViewAll=true&bViewAll=true&bViewAll=true&bViewAll=true&bViewAll=true&bViewAll=true.plain.txt
These files shouldn't be in output, am I right?
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
Depends on the following items: None found
Items that depend on this one: None found
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.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 5 latest changes.
Copyright © 2022 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.9