© 2023 PodTECH IO
All rights reserved.

Get in Touch

Perl

Recursively Expand a NIS Netgroup

Recursively Expand a NIS Netgroup @results=expand_ng(); # Given a netgroup, will return a list of members. Will recurse # netgroups if the $recurse flag is set sub expand_ng { my($netgroup)=@_; my(@returnng); my($ng)=`ypmatch $netgroup netgroup`; $? != 0 and return; #Don’t continue for duff netgroups my($value); $ng =~ s/\s+/ /g; #Compress whitespace $ng =~ s/\s+,/,/g; #Remove […]