in reply to Re: count of USER UNIX groups
in thread count of USER UNIX groups

Sorry for the confusion! "groups $USER" in unix---> gives list of my unix groups. How can we get our unix groups list and count in perl? Thanks!

Replies are listed 'Best First'.
Re^3: count of USER UNIX groups
by pme (Monsignor) on Jan 25, 2015 at 09:29 UTC
Re^3: count of USER UNIX groups
by Anonymous Monk on Jan 25, 2015 at 13:49 UTC

    A brief google leads to this node, which deals with listing a user's secondary groups, you can adapt the answers from there to suit your needs. The primary group of a user can be retrieved with getpwent. You may also want to use User::pwent and User::grent for a nicer interface to those functions.