Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Array parameter for supplementary groups?



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