Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

(MeowChow) Re3: 2048 character limit

by MeowChow (Vicar)
on Jun 06, 2002 at 08:38 UTC ( #172108=note: print w/ replies, xml ) Need Help??


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


Comment on (MeowChow) Re3: 2048 character limit
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://172108]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-11-20 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (101 votes), past polls