Overall Goal:
Well what I want to do is print out all the users in the passwd file and
match them up to their respective groups
I can open up the passwd file and the group file but I don't know how to
merge them together.
Ideally I would like to possibly put the group file in a hash but as you can
see my ablity in hashes is limited.
Current Problem:
Trying to join or push an element onto any array
Thanks in Advance
#############################################
!#/usr/local/bin/perl
$passcmd = '/usr/bin/ypcat passwd.byname |';
$groupcmd = '/usr/bin/ypcat group.byname |';
sub pass {
open(PASSWD, $passcmd);
while(<PASSWD>) {
($name,$pass,$uid,$gid,$gcos,$home,$shell) = split(/:+/);
print "$uid,$name,$gcos,$home\n";
}
close PASSWD;
}
sub group {
open(GROUP, $groupcmd);
while(<GROUP>) {
($gname,$gpass,$ggid,$member) = split(/:+/);
#$HASH{gname} = $member;
#print "@HASH{`root`}";
print "$gname";
}
close GROUP;
}
sub third {
&pass;
}
@passwd = &pass;
@group = &group;
#print @passwd;
$users = join($gname,@passwd);
print "$users\n";
###################################
CDC-IXIS
212.891.1935
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]