[654] in Info-AFS_Redistribution
Re: is there a way to get a listing of pts group names?
daemon@ATHENA.MIT.EDU (sasrpj@unx.sas.com)
Tue Mar 10 14:51:14 1992
To: info-afs@transarc.com, paulinel@ajones.austin.ibm.com (Pauline Li)
In-Reply-To: Your message of "Mon, 09 Mar 92 11:15:37 EST."
Date: Tue, 10 Mar 92 13:33:04 EST
From: sasrpj@unx.sas.com
> Date: Mon, 9 Mar 1992 11:15:37 -0600
> From: paulinel@ajones.austin.ibm.com (Pauline Li)
> Subject: is there a way to get a listing of pts group names?
> Cc: paulinel@mirage.austin.ibm.com
>
> Hi,
> I was wondering if there is a command (in AFS 3.1 or 3.2) which will
> allow a user to list all the pts group names in the pts database. This
> is useful to me because I want to be able to query the database to find
> out if a group already exists with the members I need. pts membership
> doesn't quite cut it. I'd rather not create another group if one exists
> and I just don't know about it. If there is no command to do what I want
> (I haven't found one that does), does anybody have suggestions on how to
> get this listing of group names? Thanks.
>
> -Pauline
I just now cobbled something together that seems a little less brute
force than Dawn Stokes's version:
#!/bin/ksh
pts listmax | awk '{print $NF}' | read Max
integer i=-1
while (( i > $Max )) ; do
pts exa -id $i
((i = i - 1))
done > /tmp/ptsgroups
# End of Script
Note: pts exa will spit out numerous messages for non-existent
groups as seen below:
pts: User or group doesn't exist so failed to find entry for (id: -1)
Basically, this mini-script gets the highest (lowest?) group id,
and walks through the negative ids (group ids) and writes out the
pertinent information. Obviously, you could filter the output from
pts exa to exclude the pieces you don't want.
Hope this helps,
Bob Janka
------------------------------------------------------------------------
Bob Janka SAS Institute, Inc. My opinions are my own!!
sasrpj@unx.sas.com SAS Campus Drive
(919) 677-8000 x7788 Cary, NC 27513
------------------------------------------------------------------------