Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Array parameter for supplementary groups?
- X-seq: zsh-users 15718
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Array parameter for supplementary groups?
- Date: Tue, 18 Jan 2011 20:05:18 +0000
- In-reply-to: <alpine.LNX.2.01.1101181317380.2792@hp>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <alpine.LNX.2.01.1101181317380.2792@hp>
On Tue, 18 Jan 2011 13:27:53 -0500 (EST)
"Benjamin R. Haskell" <zsh@xxxxxxxxxx> wrote:
> Is there an array parameter for the group IDs of the current user? Am I
> overlooking it?
No, but if you speak Unreadable you can create one quite quickly...
idgroups() {
emulate -L zsh
setopt extendedglob
typeset -gA groups
groups=(
${=${${(s.,.)${${$(id):#^groups=*}##groups=}}/(#b)(*)\((*)\)/$match[2]\
$match[1]}}
)
}
Of course if we had discipline functions blah blah blah.
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author