You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs say "**/ Matches any number of characters, including path separators, excluding the empty string.", but this does not seem to match what I see in practice.
I see the following, where each M is a file
$ tree
.
├── A
│ └── M
├── B
│ ├── C
│ │ └── M
│ └── M
└── M
With zsh, for comparison, as that is what I traditionally associate this syntax with
(**/M matches the same as zsh does on this example)
(**/ does not behave the same as zsh)
**/M matches M (seeming to show that **/ can match the empty string)
**/ only picks up A and B and not B/C/ when running via globDir1, but **/ matches the string B/C/ (but not B/C)
**/ does not match any files!
The behaviour seems to be more akin to **/ will match any (potentially empty) sequence of directories, but may or may not match nested directories/be recursive based on some subtle details". This seems rather weird, so I doubt this is the actual behaviour. Some clarification on what this pattern does would be appreciated.
The text was updated successfully, but these errors were encountered:
In addition to the documentation, it seems that the behaviour is wrong.
That first globDir1 should certainly return ./B/C/ as well; in general globDir1 pat should correspond exactly to a filter (match pat) over a recursive directory listing.
**/M matching "M"feels wrong, though I can't say for sure whether there may have been a reason for it. As you point out, it conflicts with the documentation at the very least.
In general zsh was the inspiration for the default behaviour so any conflicts are more likely than not to be a bug in Glob.
The docs say "
**/
Matches any number of characters, including path separators, excluding the empty string.", but this does not seem to match what I see in practice.I see the following, where each
M
is a fileWith zsh, for comparison, as that is what I traditionally associate this syntax with
With Glob
Notice:
**/M
matches the same as zsh does on this example)**/
does not behave the same as zsh)**/M
matchesM
(seeming to show that**/
can match the empty string)**/
only picks upA
andB
and notB/C/
when running viaglobDir1
, but**/
matches the stringB/C/
(but notB/C
)**/
does not match any files!The behaviour seems to be more akin to
**/
will match any (potentially empty) sequence of directories, but may or may not match nested directories/be recursive based on some subtle details". This seems rather weird, so I doubt this is the actual behaviour. Some clarification on what this pattern does would be appreciated.The text was updated successfully, but these errors were encountered: