This is quite an easy one for you guys, but I can't find a definitive/formal answer to this question.
Suppose we are in directory A. Then,
"A/* " probably means: Every file and folder directly inside A.
"A/** " then may mean: Every file and folder inside A, and every file and folder directly inside every child that is directly inside A. (Basically, an extension of /* operator that traverses one level deeper of the root folder? aka "/** " = "/* /* " )
My "directly inside" terminology might be wrong. May be its better to say "direct child" or something, but you get the idea.
Then, what does "A/**/* " mean? Is it equal to "A/* /* /* " ?
Although this seems basic, its quite confusing when I don't have a formal definition of the operators.
I'm currently using Javascript and trying to modify a Gruntfile. But I guess these operators may come up in any context.
This behavior is not intrinsic to JavaScript and is not related to any operators: as far as JavaScript is concerned, it is just a string.
The handling of such glob expansion is determined by the specific library/consumer. For gruntjs it is covered in Grunt Globbing Patterns:
As such (but refer to the specific documentation!),
/**/
generally means "match any depth of directories" and/*/
or/*
means "match a single directory or file part".The gruntjs documentation is a bit vague on the specific mechanics of
**
in the standard"/**/*.x"
pattern, but referring to node-glob says:Using this knowledge we get the equivalency (when used as a path component), of
A/**/f
withA/f
,A/*/f
,A/*/*/f
, etc for every number of intermediate directories.