Alwanza Home UW Linux Administration
#!/usr/bin/perl


# command line looks like:
# script.pl /etc/passwd

chomp(@passwd = <ARGV>);

$cnt = 0;
foreach (@passwd) {
    @curline = split (/:/, $_);
    $un[$cnt] = $curline[0];
    $ep[$cnt] = $curline[1];
    $uid[$cnt] = $curline[2];
    $gid[$cnt] = $curline[3];
    $gc[$cnt] = $curline[4];
    $hd[$cnt] = $curline[5];
    $sh[$cnt] = $curline[6];
    $cnt++;
}
print "Which item number do you want? ";
chomp ($num = <STDIN>);
# correct for array starting with zero
$num++;
print "That number corresonds to the username $un[$num]\n";
print "With a UID of $uid[$num], a GID of $gid[$num]\n";
print "Who has a Home directory at $hd[$num]\n";
print "And uses the $sh[$num] shell.\n";



#*********** END *********