From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1753 invoked from network); 11 Feb 2006 18:10:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Feb 2006 18:10:34 -0000 Received: (qmail 28671 invoked from network); 11 Feb 2006 18:10:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Feb 2006 18:10:28 -0000 Received: (qmail 3497 invoked by alias); 11 Feb 2006 18:10:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22228 Received: (qmail 3487 invoked from network); 11 Feb 2006 18:10:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Feb 2006 18:10:22 -0000 Received: (qmail 28034 invoked from network); 11 Feb 2006 18:10:21 -0000 Received: from rm-001-08.serve.com (HELO support.lxlabs.com) (65.23.159.4) by a.mx.sunsite.dk with SMTP; 11 Feb 2006 18:10:19 -0000 Received: (qmail 21513 invoked by uid 0); 11 Feb 2006 18:31:25 -0000 Received: from btnl-kk-dsl199.39.144.59.touchtelindia.net (HELO localhost) (postmaster@lxlabs.com@59.144.39.199) by support.lxlabs.com with SMTP; 11 Feb 2006 18:31:25 -0000 Date: Sat, 11 Feb 2006 23:51:05 +0530 From: Ligesh To: Zsh-workers Subject: Re: Regexp replace on all arguments. Message-ID: <20060211182105.GA7789@lxlabs.com> References: <20060211173626.GA6863@lxlabs.com> <20060211173818.GA4965@sc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060211173818.GA4965@sc> User-Agent: Mutt/1.5.10i On Sat, Feb 11, 2006 at 05:38:19PM +0000, Stephane Chazelas wrote: > winexec() { > local cmd=$1 > shift || return > argv=("${@//#\/(#b)([a-zA-Z])\//$match:}") > "$cmd" "$@" > } > I couldn't get it to work. There is no substitution happening at all. I am getting the same arguments. winexec cacl.exe /c/name-fo-file gives: cacls.exec /c/name-of-file. I am sure the code is the right direction, and but there is some silly bug which makes it fail. I am actually used to vim/emacs syntax for string substitution, but I found the zsh syntax to be a bit exotic. Especially since zsh has SO many special cases. So if you could explain the above, I would be able to correct it myself. argv=("${@//#\/(#b)([a-zA-Z])\//$match:}") I take it that the first '@' stands for all arguments. What's the /#? what's (#b)? ([a-zA-Z]) stands for 1 character, enclosed in a paranthesis for its use in the replace regexp. Thanks.