[Toybox] find(1) -name vs -wholename

enh enh at google.com
Mon Mar 4 10:19:22 PST 2024


obviously the patch is trivial, but i can't think of an existing
toybox tool that has one of these "you're holding it wrong" errors,
but this is one that i do find useful:

~/aosp-main-with-phones/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8$
find . -name bits/syscall.h
find: warning: ‘-name’ matches against basenames only, but the given
pattern contains a directory separator (‘/’), thus the expression will
evaluate to false all the time.  Did you mean ‘-wholename’?

(of course, it's also a bit like the macOS `grep -r` "hey, i'm just
going to sit here doing nothing because -r defaults to stdin rather
than the `.` that you obviously intended" where i'm left wondering why
it can't just do the right thing... since `/` is illegal in a POSIX
name, what other interpretation could there be? but, still, better
than nothing.)


More information about the Toybox mailing list