find omits dollar signs in filenames

Olf <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Hi,

the GNU find utility does not output dollar signs embedded in filenames, i.e. it emits non-matching filenames!  I am pretty sure that this in not the intended behaviour.

I came across this when creating a command line which properly handles  filenames with unusual characters, for which I created three test files starting with "ab".  Note that ls correctly outputs the dollar sign as third character of the second filename, but find does not:

$ ls -1q ab*
'ab"cd'\''ef()gh:;ij'
'ab'$'\n''cd'$'\t''ef*gh?jk lm'
'ab[x-y]c{1,2,3}d{4..6}e'
$ find -L . -maxdepth 1 -type f -name 'ab*' -print
./ab?cd?ef*gh?jk lm
./ab"cd'ef()gh:;ij
./ab[x-y]c{1,2,3}d{4..6}e
$ find -L . -maxdepth 1 -type f -name 'ab*' -print0 | tr '\0' '\n'
./ab
cd	ef*gh?jk lm
./ab"cd'ef()gh:;ij
./ab[x-y]c{1,2,3}d{4..6}e
$ find -L . -maxdepth 1 -type f -name 'ab*' -print0 | tr '$\0' 'A\n'
./ab
cd	ef*gh?jk lm
./ab"cd'ef()gh:;ij
./ab[x-y]c{1,2,3}d{4..6}e
$ find --version
find (GNU findutils) 4.7.0
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2) 
$ 

-- 
Cheers,
Olf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.