Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: Selecting leaf directories only



>
> Andrej Borsenkow <Andrej.Borsenkow@xxxxxxxxxxxxxx> typed:
> :**/*(/) gives me all (sub-)directories. Any easy way to get leaf
> directories
> :only? I.e. in case
> :the above gives me ``foo foo/bar foo/baz'' while I want ``foo/bar foo/baz''
> :only.
>
> */**/*(/)
>
>

Black magic. Awesome :-)

But it does not completely solve the problem (it does in my specific case,
thank you). It needs at least two levels; i.e. in case

foo/
  bar1/
  bar2/
baz/

it skips ``baz'' that is leaf directory as well.

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author