From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1359 invoked from network); 6 Dec 2006 19:35:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) 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.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Dec 2006 19:35:05 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 69275 invoked from network); 6 Dec 2006 19:34:55 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Dec 2006 19:34:55 -0000 Received: (qmail 3332 invoked by alias); 6 Dec 2006 19:34:36 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11063 Received: (qmail 3321 invoked from network); 6 Dec 2006 19:34:35 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Dec 2006 19:34:35 -0000 Received: (qmail 67254 invoked from network); 6 Dec 2006 19:34:35 -0000 Received: from wr-out-0506.google.com (64.233.184.229) by a.mx.sunsite.dk with SMTP; 6 Dec 2006 19:34:30 -0000 Received: by wr-out-0506.google.com with SMTP id i28so205309wra for ; Wed, 06 Dec 2006 11:34:29 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tKVms1Yx5yU5pvW9emvpaH1SJfp2ffwk+saoG97GR+a0bxNGPNQ4W1sSVGjMQnz9aGgvEtaLcJWenXZ1CieaamrOmlkJo9ViwauuFHOXwa8gsiUeirBAeENIndYuNPIsDZmqLVRCqbgssqxBKkm2vG8CPuRdKL749Ah2u9o6D2c= Received: by 10.78.157.8 with SMTP id f8mr823612hue.1165433668084; Wed, 06 Dec 2006 11:34:28 -0800 (PST) Received: by 10.78.184.5 with HTTP; Wed, 6 Dec 2006 11:34:28 -0800 (PST) Message-ID: Date: Wed, 6 Dec 2006 14:34:28 -0500 From: TjL To: "Paul Johnson" Subject: Re: Scripting situation I cannot wrap my head around Cc: "Zsh Users List" In-Reply-To: <20061205234347.GG2596@pjcj.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20061205154041.GA10583@princo> <20061205234347.GG2596@pjcj.net> On 12/5/06, Paul Johnson wrote: > On Tue, Dec 05, 2006 at 10:40:41AM -0500, Jean-Rene David wrote: > > However I think a text processing tool would be > > more appropriate than a shell for this kind of > > task: > > I was thinking the same thing. Well all you have is a shell scripting hammer :-) I had originally thought about using 'read' statements and entering the conversation directly into the shell, but the more I thought about it the more it seems like a flat file was the way to go. Unfortunately the only thing I know about perl is that I've failed to learn how to use it whenever I tried to learn. > > % perl -ne 'BEGIN { %person=(); } \ > > /^([a-zA-Z]+)(:)(.*)$/ && \ > > print "$1" . ++$person{$1} . "$2$3\n";' < dialog.file > > perl -pe 's/\w+/$& . ++$person{$&}/e' dialog.file > > or maybe you don't really want people to understand what you are doing: > > perl -pe 's((?=:))?++${$`}?e' dialog.file Well I don't really understand either of them, but it works, so I'm very glad for the help and since it isn't really a zsh question any more I'll move on. > Interesting conversation, by the way. OT - Well the actual verbatims usually are fairly interesting. I'm taking a unit of CPE (Clinical Pastoral Education) at a local hospital. It involves a lot of knocking on the door and walking into a room having no idea who you are going to meet and whether or not they will be welcoming (which happens quite often), hostile (which happens occasionally), busy/asleep (which happens frequently), or apathetic to your existence on the planet and presence in their room (which happes the rest of the time). Unfortunately the details are covered under HIPPA or HIIPA or however it's spelled. Thanks for the help ZshFolk! TjL