http://qs1969.pair.com?node_id=172108


in reply to Re: Re: 2048 character limit
in thread 2048 character limit

Try running this:
  
#!/usr/bin/perl -w use strict; open my $fh_group, "</etc/group" or die "Cannot open group file"; while (<$fh_group>) { chomp; my ($grp, $pwd, $gid, $users) = split /:/; if ($grp eq $ARGV[0]) { my @users = split /,/, $users; print join $/, @users; } }
Save it to a file, and run it with a command line argument of the group you'd like to check membership for, for example:
perl program.pl steel
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print