From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12971 invoked by alias); 29 Oct 2015 10:26:04 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20852 Received: (qmail 23348 invoked from network); 29 Oct 2015 10:26:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: vogt@linux.vnet.ibm.com X-IBM-RcptTo: zsh-users@zsh.org Date: Thu, 29 Oct 2015 11:15:50 +0100 From: Dominik Vogt To: Zsh Users Subject: Re: Recursive globbing shorthand (a la **.c) Message-ID: <20151029101550.GB5820@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: Zsh Users References: <20151028065702.GA8236@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15102910-0041-0000-0000-000006277217 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