From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15432 invoked from network); 4 May 2001 22:17:26 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 May 2001 22:17:26 -0000 Received: (qmail 5864 invoked by alias); 4 May 2001 22:17:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14226 Received: (qmail 5844 invoked from network); 4 May 2001 22:17:19 -0000 From: "Bart Schaefer" Message-Id: <010504151555.ZM19588@candle.brasslantern.com> Date: Fri, 4 May 2001 15:15:55 -0700 In-Reply-To: <3AF2E46F.AB08FFB8@u.genie.co.uk> Comments: In reply to Oliver Kiddle "chown completion" (May 4, 6:18pm) References: <3AF2E46F.AB08FFB8@u.genie.co.uk> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Oliver Kiddle , zsh-workers@sunsite.dk Subject: Re: chown completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 4, 6:18pm, Oliver Kiddle wrote: > Subject: chown completion > > How could I avoid the two consecutive _files calls to specify files > where either the user is not $usr or the group is not $grp? > *(^u.$usr.g.$grp.) matches files where user is not $usr AND group is > not $grp. Comma-separated list: *(^u.$usr.,^g.$grp.) > It could also restrict files to those owned by the current user (unless > it is root) as you can't chown other people's files. True. > Any ideas on how it should deal with invalid users or groups? As it is, > it displays `_path_files:330: unknown user' which isn't too bad really. That line in _path_files really should be eval 'tmp1=( $~tmp1 )' 2>/dev/null Most expansion errors will be caught before it gets that far, but not those that result from "mistakes" in the globbing flags. On the other hand, if we'd suppressed that error message, you'd never have found: > Incidentally, if I separate the user/groups with a colon, not a dot in > the glob, I get this message: > _path_files:330: bad pattern: *(^g:users I think this is related to the pattern that attempts to rewrite the glob flags to implement the file-sort style. I've had trouble with that before. > + if (( GID && $+commands[groups] )); then Shouldn't you be using EGID there? I don't know the answers to any of the other questions, sorry.