From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2877 invoked from network); 12 Jan 1998 22:22:52 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 12 Jan 1998 22:22:52 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id RAA13816; Mon, 12 Jan 1998 17:11:03 -0500 (EST) Resent-Date: Mon, 12 Jan 1998 17:10:46 -0500 (EST) Message-ID: <19980112221212.47183@thelonious.new.ox.ac.uk> Date: Mon, 12 Jan 1998 22:12:12 +0000 From: Adam Spiers To: zsh-users@math.gatech.edu Subject: Re: Exporting arrays Reply-To: Adam Spiers References: <34BA1F3D.18EE4BAB@rrz.uni-hamburg.de> <199801121515.PAA11821@taos.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84 In-Reply-To: <199801121515.PAA11821@taos.demon.co.uk>; from Andrew Main on Mon, Jan 12, 1998 at 03:15:00PM +0000 Resent-Message-ID: <"I9rkE3.0.LN3.bJfkq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1223 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Andrew Main (zefram@tao.co.uk) wrote: > Bernd Eggink wrote: > > a=(${(s(:))aex}) > > > >Unfortunately this doesn't work if an array element is empty! Example: > > Both behaviours are useful. What would really be nice would be to > make the delimiter a glob pattern, so that both behaviours (and more) > are available. That would make the default behave the way you want it, > which is probably better overall, because if one really wanted the other > form of splitting then this would become immediately obvious. Many thanks to all who replied. If I had had my brain switched on at the time I would have realised that environment variables cannot be arrays; I even missed the rather obvious hint that some shells don't have arrays at all! Doh. Anyway, while we're on the topic of making tiny nooks and crannies of zsh into potential glob patterns, can I ask what's the deal with the pattern in compctl ... -x C[offset,pattern] ... ^^^^^^^ and also for W[] and R[]? Is that glob patterns also, or something else? I ask, because I can't get it working. I want a condition like C[0,abcd????] i.e. only completes when the current word is abcd followed by four other characters (preferably digits only, if that was possible). When I try that compctl, it offers no completions at all :-( An another related note, can there be some provision in globbing for the equivalents of the regexps x{n} x{n,} x{,m} x{n,m} for non-trivial n and m? At the moment it seems you can only specify none, one or many. By the way, if anyone's interested, I'm slowly making progressing with a patch that implements dabbrev-expand (see my post on Jan 2nd). However I'm a complete novice at hacking the internals of shells, so I'm not sure whether the end product would be worthwhile even if it worked (although I think the patch required should be pretty small so maybe there's not too much scope for error). Should I join the zsh-workers list?