From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5064 invoked by alias); 18 Jan 2011 20:05:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15718 Received: (qmail 18471 invoked from network); 18 Jan 2011 20:05:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.49 as permitted sender) Date: Tue, 18 Jan 2011 20:05:18 +0000 From: Peter Stephenson To: Zsh Users Subject: Re: Array parameter for supplementary groups? Message-ID: <20110118200518.4fab9876@pws-pc.ntlworld.com> In-Reply-To: References: X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.0; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=R50lirqlHffDPPkwUlkuVa99MrvKdVWo//yz83qex8g= c=1 sm=0 a=ttx2jlX6pqQA:10 a=kj9zAlcOel0A:10 a=YQfN4TnuAAAA:8 a=NLZqzBF-AAAA:8 a=HxtOqmfEkzvNvHmZ7xUA:9 a=LRcqjl4gt0azBduH7nBWK8Gdsv0A:4 a=CjuIK1q_8ugA:10 a=bxnOgZBHIjQA:10 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On Tue, 18 Jan 2011 13:27:53 -0500 (EST) "Benjamin R. Haskell" 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 Web page now at http://homepage.ntlworld.com/p.w.stephenson/