
newbie-perl or why am i blind to this simple
ok so i'm new to perl and i'm trying to do what should be simple but i must
be blind. pointers requested, yes i do have the lama and camel books; but
like i said i must be blind. helpfull hints appreciated.
bill
what i'm after:
parse /etc/group
pull out the usernames from a group (ask which group first)
read /etc/passwd for the home dir
reset the default group based on something (whatever,not germain to this)
what i get:
ignores the last name in a group unless there is a trailing ,
to follow: code snippit, yea it's verbose but i'm trying to learn whats
happening so i expanded it.
#!/usr/lbin/perl
# this will pull the userid's out of /tmp/group based on the group name
# provided in response to a prompt. and it will look up info about them in
# /etc/passwd
#
print "For what group do you wish a list of members?\n";
chop ($group_requested = <STDIN>);
open (FILENAME, "/tmp/group");
while (<FILENAME>)
{
{
if (/^$group_requested/)
{
$group_name = $_;
{
print "$login,$home\n";
print "$user_id ";
print (getpwnam("$user_id"))[1-7];
print "\n";
}
# print "$userid[3]\n";
}
}
}
close (FILENAME);
bill pociengel
so what is the wow wow wibble wobble wozzey woddle woo?
'so what's a flame but a polite message reduced to it's essence?'
lilb pleceoing 'I'm a little confused right now'