File group listing : User « System Functions « Perl






File group listing

      

#!/usr/bin/perl

use warnings;
use strict;

use User::grent qw(:FIELDS);

while (my $group = getgrent) {
    print 'Name    : ', $gr_name, "\n";
    print 'Password: ', $gr_passwd, "\n";
    print 'Group ID: ', $gr_gid, "\n";
    print 'Members : ', join(', ', @{$group->members}), "\n\n";
}

   
    
    
    
    
    
  








Related examples in the same category

1.Expired user
2.List group
3.Quota, change or age
4.Use User::pwent to access user data