From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from techfac.techfak.uni-bielefeld.de ([129.70.132.100]) by hawkwind.utcs.toronto.edu with SMTP id <2779>; Wed, 4 Nov 1992 09:25:55 -0500 Received: from dahlie.TechFak.Uni-Bielefeld.DE by techfac.techfak.uni-bielefeld.de (5.65+bind 1.7+ida 1.4.2/tp.270592) id AA10553; Wed, 4 Nov 92 15:25:34 +0100 Received: by dahlie.techfak.uni-bielefeld.de (4.1/tp.29.0890) id AA18713; Wed, 4 Nov 92 15:25:33 +0100 Date: Wed, 4 Nov 1992 09:25:33 -0500 From: malte@techfak.uni-bielefeld.de Message-Id: <9211041425.AA18713@dahlie.techfak.uni-bielefeld.de> To: rc@hawkwind.utcs.toronto.edu Subject: Re: set subtract In-Reply-To: Mail from 'rsalz@osf.org' dated: Wed, 4 Nov 1992 09:12:36 -0500 Easy; the following just uses built-ins. Note that it implements the example (first arg is a pattern, not a list of patterns); I don't believe the synopsis can be done. fn index { pat=() i=() result=() count=() { pat=$1 shift || { echo 'Usage error' >[1=2] ; return 1 } for (i) { count=(a $count) eval ~ $i $pat && result=($result $#count) } echo $result } } Fine, this is similar to what I do now. Why a built in command ? Imagine $pat has a value of '$something'. This will break it. Malte