Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Recursive globbing shorthand (a la **.c)
- X-seq: zsh-users 20852
- From: Dominik Vogt <vogt@xxxxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Recursive globbing shorthand (a la **.c)
- Date: Thu, 29 Oct 2015 11:15:50 +0100
- In-reply-to: <CAHYJk3TjmMEYZ-j5VT=D4WDPtZZkFVzKNXzYw9vxZReC0o-FZg@mail.gmail.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>
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20151028065702.GA8236@linux.vnet.ibm.com> <CAHYJk3TjmMEYZ-j5VT=D4WDPtZZkFVzKNXzYw9vxZReC0o-FZg@mail.gmail.com>
- Reply-to: vogt@xxxxxxxxxxxxxxxxxx
On Wed, Oct 28, 2015 at 02:27:38PM +0100, Mikael Magnusson wrote:
> If this is something you do often, you can do
> alias -g '**.c=**/*.c'
It *is* something I do a lot, but with varying patterns. A kind
of "regexp" alias woud allow that:
alias -R REGEXP=REPLACEMENT # usual regexp syntax plus back references
alias -g -R [.][.][.]='../..'
alias -g -R [*][*]\([^*/]\)='**/*\1'
(or give up the pretense that "search and replace" can be
expressed as "x=y" patterns:
alias -g -R 's:[.][.][.]:../..:g' # replace all (g flag)
alias -g -R 's:[*][*]([^*/]):**/*\1:' # replace one (no flags)
)
I frequently miss such a feature that allows some user defined
preprocessing of command lines.
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany
Messages sorted by:
Reverse Date,
Date,
Thread,
Author