Help for this page

Select Code to Download


  1. or download this
    use POSIX qw(getgroups);
    # get list of the current groups for this process
    my @gidlist=getgroups();
    # you'd  have to translate numeric gid's to 
    # the names here
    
  2. or download this
    while ( my($name,$pw,$gid,$members) = getgrent ) {
      push(@rgids,$gid) if ( grep($_ eq $user,split(/\s+/,$members)) );
    }