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

Array parameter for supplementary groups?



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



Messages sorted by: Reverse Date, Date, Thread, Author