From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17178 invoked from network); 26 Oct 2005 09:48:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Oct 2005 09:48:18 -0000 Received: (qmail 64329 invoked from network); 26 Oct 2005 09:48:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Oct 2005 09:48:10 -0000 Received: (qmail 3385 invoked by alias); 26 Oct 2005 09:48:03 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9563 Received: (qmail 3376 invoked from network); 26 Oct 2005 09:48:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Oct 2005 09:48:02 -0000 Received: (qmail 63225 invoked from network); 26 Oct 2005 09:48:02 -0000 Received: from cluster-c.mailcontrol.com (HELO rly10c.srv.mailcontrol.com) (168.143.177.190) by a.mx.sunsite.dk with SMTP; 26 Oct 2005 09:48:01 -0000 Received: from exchange03.csr.com (mailhost1.csr.com [81.105.217.43]) by rly10c.srv.mailcontrol.com (MailControl) with ESMTP id j9Q9lxKd011993 for ; Wed, 26 Oct 2005 10:47:59 +0100 Received: from csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 26 Oct 2005 10:50:16 +0100 To: Zsh Users Subject: Re: Per line ${..//..} In-reply-to: <20051026094047.GA658@DervishD> References: <20051026094047.GA658@DervishD> Comments: In-reply-to DervishD message dated "Wed, 26 Oct 2005 11:40:47 +0200." Date: Wed, 26 Oct 2005 10:47:58 +0100 From: Peter Stephenson Message-ID: X-OriginalArrivalTime: 26 Oct 2005 09:50:16.0822 (UTC) FILETIME=[AB4E2960:01C5DA12] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-05-40-01 (www.mailcontrol.com) on 10.67.0.120 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 DervishD wrote: > I have a parameter containing a bunch of lines, and I have to get > rid of comments (that is "$line" == (#s)[" $'\t'"]#\#*(#e)) and empty > lines (that is "$line" == (#s)[" $'\t'"]#(#e)). I've tried using the > ${..//..} syntax for doing substitutions in parameters, but with no > success because I don't know how to properly mark the beginning and > end of a line. You can do something like: % lines=(foo "# comment" bar " ") % print -l $lines foo # comment bar % print -l ${lines:#[[:space:]]#(\#*|)} foo bar pws This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com