From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18074 invoked from network); 11 Feb 2006 17:25:52 -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 17:25:52 -0000 Received: (qmail 84051 invoked from network); 11 Feb 2006 17:25:46 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Feb 2006 17:25:46 -0000 Received: (qmail 23039 invoked by alias); 11 Feb 2006 17:25:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22225 Received: (qmail 23023 invoked from network); 11 Feb 2006 17:25:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Feb 2006 17:25:43 -0000 Received: (qmail 83632 invoked from network); 11 Feb 2006 17:25:43 -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 17:25:41 -0000 Received: (qmail 21320 invoked by uid 0); 11 Feb 2006 17:46:45 -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 17:46:45 -0000 Date: Sat, 11 Feb 2006 23:06:26 +0530 From: Ligesh To: Zsh-workers Subject: Regexp replace on all arguments. Message-ID: <20060211173626.GA6863@lxlabs.com> Reply-To: myself@ligesh.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.10i Hi folks, I want to replace all occurrences of say '/c/' in the arguments with 'c:'. Could someone help me with completing the function below. winexec () { // First loop through all arguments and replace foreach arguments $2 to $- { replace ^/c/ with c: , ^/d/ with d: etc. (The character c, d should be preserved, '^' means beginning of the word.) } execute $1 with the new arguments. } The execution would be $ winexec cacls.exe /c/name-of-file Now the function should change it to: $ calcs.exe c:/name-of-file Thanks in advance.