zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Oliver Kiddle <opk@u.genie.co.uk>, zsh-workers@sunsite.dk
Subject: Re: chown completion
Date: Fri, 4 May 2001 15:15:55 -0700	[thread overview]
Message-ID: <010504151555.ZM19588@candle.brasslantern.com> (raw)
In-Reply-To: <3AF2E46F.AB08FFB8@u.genie.co.uk>

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.


  reply	other threads:[~2001-05-04 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-04 17:18 Oliver Kiddle
2001-05-04 22:15 ` Bart Schaefer [this message]
2001-05-07  9:17 ` Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010504151555.ZM19588@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).