#!/usr/local/bin/perl

while ($_= <>)
{
    /^(\w+)/;

    ($name, $passwd, $uid, $gid, $quota, 
     $comment, $gcos, $dir, $shell) = getpwnam($1);

    $gcos =~ s/[ ,]*$//;
    print "$dir = $gcos\n" if $dir;

}
