Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Recursive globbing shorthand (a la **.c)
- X-seq: zsh-users 20840
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: vogt@xxxxxxxxxxxxxxxxxx, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Recursive globbing shorthand (a la **.c)
- Date: Wed, 28 Oct 2015 14:27:38 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=bOHpx5uaO3tfmWQ+EqQYh6SvZ6yTYV6nDuJ7Ct8MJNs=; b=roIZ1Z1a5pYIsSKItwRFu7+r5C7N14XVvXmnFHYM1QbIzzgTKomOAZnBIz7FwQL+0r ODKhM6IYuG/8FPSFVkl6UZEOZbNDFi0bZ7UdWXnOJHw+iQlP44SCYHxJlDXC36MH//XO gxUZUy+7MvkNQrooTSX8N+6lfkC5Cj1U+beU/5NkO8IEkaBSHp4ciRt/EgH60NvaKi6M 05VJTMG6JymzJ93bzj0UqCh+HQGKU5pKPFmhCuIK1oz4m0hIU1EIqnv1hYlmH8Z6hK8q m52mbMIJI2ggTlPheb3HH55+UTpvt3Ns0BJyqr8ZpCPxfMky43y2JI4se7Q1TiTzMXhf 1ifg==
- In-reply-to: <20151028065702.GA8236@linux.vnet.ibm.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20151028065702.GA8236@linux.vnet.ibm.com>
On Wed, Oct 28, 2015 at 7:57 AM, Dominik Vogt <vogt@xxxxxxxxxxxxxxxxxx> wrote:
> Most of the time, I use recursive globbing to find files of
> certain types, e.g.
>
> $ ll **/*.c
>
> With the zsh here (4.3.17), recursive globbing works only
> with a plain ** anyway (i.e. in "**x" and "x**" the ** works just
> like a plain "*"). So, is it possible (or a useful future
> feature) to make "**" imply a trailing "/*" if not with a trailing
> pattern? Then we could type
>
> $ ll **.c
>
> as a shorthand, and the "traditional" uses would work without
> change (e.g. **/*.c or **/foo).
>
> (Note that on German keyboards, "/" and "*" are very awkward to
> type in a sequence because both need the left shift key held and
> the keys for the right hand are very far apart, so this is really
> a usability issue.)
If this is something you do often, you can do
alias -g '**.c=**/*.c'
I don't think it's useful to implement generally though, there's no
particular reason to assume the pattern following the **/ should start
with a *
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author