bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Following symlinks in globstar (part 2)


From: Greg Wooledge
Subject: Re: Following symlinks in globstar (part 2)
Date: Wed, 11 Apr 2018 11:26:53 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, Apr 11, 2018 at 06:16:19PM +0300, Ilkka Virta wrote:
> So, given
> 
> .
> |-- dir
> |   +-- link -> ../otherdir
> +-- otherdir
>     +-- subdir
>         +-- foo
> 
> (that is: mkdir -p dir otherdir/subdir; ln -s ../otherdir dir/link; touch
> otherdir/subdir/foo )
> 
> dir/**/foo  does not match anything, but  dir/**/subdir  matches
> dir/link/subdir , i.e.  **  looks through the link, but doesn't recurse
> through it? Did I get that right?
> 
> That does seem somewhat surprising. The documentation on globstar doesn't
> seem to mention anything about behaviour re. symlinks either.

What I'm seeing is that **/file in my example, or dir/**/subdir in
your example, acts as if a single * glob had been used.  I.e.
you get (dir/link/subdir) because dir/*/subdir would have matched that,
and I get (dir/file link/file) because */file would have matched that.

With just those two examples, it looks like ** tries to match like
a regular * first, and then only tries recursion if that fails.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]