zsh-users
 help / color / mirror / code / Atom feed
* Array parameter for supplementary groups?
@ 2011-01-18 18:27 Benjamin R. Haskell
  2011-01-18 19:46 ` Dan Nelson
  2011-01-18 20:05 ` Peter Stephenson
  0 siblings, 2 replies; 3+ messages in thread
From: Benjamin R. Haskell @ 2011-01-18 18:27 UTC (permalink / raw)
  To: Zsh Users

Is there an array parameter for the group IDs of the current user?  Am I 
overlooking it?

Under Cygwin under Windows 7, right-click run-as-administrator adds some 
supplementary groups, but the user is otherwise indistinguishable, 
AFAICT.  I'd like to be able to do something like:

(( $+groups[(Re)0] )) && { do stuff for admin-style prompt }

without resorting to parsing the output of `id`.  (examples:)

running as normal:
uid=12522(bhaskell) gid=10513(Domain Users) groups=10513(Domain Users),545(Users)

running as admin:
uid=12522(bhaskell) gid=10513(Domain Users) groups=10513(Domain Users),0(root),544(Administrators),545(Users)

(I just dislike parsing when it's not necessary.)

-- 
Best,
Ben


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-18 20:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18 18:27 Array parameter for supplementary groups? Benjamin R. Haskell
2011-01-18 19:46 ` Dan Nelson
2011-01-18 20:05 ` Peter Stephenson

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).