Daniel: The shell's all treat ** as * and require that it match something. So "mkdir -p foo/bar/baz" would match.
I would expect "/*/**/*", "/**/*/*" and "/*/*/**" to all match exactly the same sets of components. No command shell that I know of (sh,bash,zsh,tcsh,csh,ksh) has a moral equivalent to "zero or more path components". Perl, python, et. al. do. Cheers, Doug On Wed, Mar 15, 2017 at 5:55 AM, Daniel Shahaf <d...@daniel.shahaf.name> wrote: > From the 1.10 draft release notes: > > > All wildcards apply to full path segments only, i.e. * never matches > > /, except for the case where /**/ matches zero or more path segments. > > For example, /*/**/* will match any path which contains at least > > 2 segments and is equivalent to /**/*/* as well as /*/*/**. > > Are «/*/**/*» «/**/*/*» «/*/*/**» really equivalent? I would have > expected the first two to match any node except / and /'s immediate > children, but I wouldn't expect the third form to match /trunk/iota > where iota is a file, since the pattern has a trailing slash after the > non-optional second component. > > Testing this in > cd $(mktemp -d) > mkdir -p foo/bar > , I see that neither vim nor zsh finds any matches for */*/**, meaning > they don't interpret ** as "zero or more" path components in this > pattern. I suppose they only treat ** in this way when it appears with > slashes immediately before and after it. > > Cheers, > > Daniel > -- *DOUGLAS B. ROBINSON* SENIOR PRODUCT MANAGER *T *925-396-1125 *E* doug.robin...@wandisco.com *www.wandisco.com <http://www.wandisco.com/>* -- Learn how WANdisco Fusion solves Hadoop data protection and scalability challenges <http://www.wandisco.com/hadoop/wd-fusion> Listed on the London Stock Exchange: WAND <http://www.bloomberg.com/quote/WAND:LN> THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED. If this message was misdirected, WANdisco, Inc. and its subsidiaries, ("WANdisco") does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of WANdisco, unless the author is authorized by WANdisco to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by WANdisco. Although WANdisco operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.