-nameso the shell won't interpret it.
find . -name *.txt
find . -name '*.txt'
Several find options take patterns to match against, including
These compete with the shell's pattern expansion, and must therefore be quoted so that they are passed literally to
The example command may end up executing as
find . -name README.txt after the shell has replaced the
*.txt with a matching file
README.txt from the current directory.
This may happen today or suddenly in the future.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.