I think that the format of this command changed since I’ve last used it, and now I’m not understanding what it expects of me.
I’m getting an error: find: unknown predicate '-name=*.xml'
The way it seem to be trying to invoke find is like this:
find . \( -name="*.xml" \) -ls
I don’t understand this syntax 🙁 Is it trying to create a nested shell? Why if so? Is it trying to create a list of arguments? Why if so?
I might just go and edit this function to remove the parenthesis, but why would anyone put them there? I must be missing something.
The parenthesis group the search terms you put together into a logical grouping so they wouldn’t affect anything else afterward. I suspect they’re put there to fully encapsulate anything you might put in there so that the
-ls(or any other option it may add due to other variable settings, etc) always executes. Parenthesis are the highest order of parenthesis. It is not trying to create a nested shell; that’s why the\s are there: it’s passing them to find itself.But your real issue is that find needs the
-namewith a space after it, not with an=sign. (ie, the argument to-nameshould be a separate argument). It doesn’t work like many of the double-dash arguments that you expect from other tools (in particular, the ones written using the GNUgetopt_longparsing implementation.So, try
-name *.xmlinstead.And for an additional piece of information, here’s the find man page about
()s: