hello
i think the proper way is to go to the /etc/passwd file and then extract the fields you want and then pass that to variable and use it to get the list if the real name
here is the code that u will use
Code:
#Author: Black-Ice
#Date: 20/6/2007
#!/usr/bin/perl -w
use strict;
my $file = "/etc/passwd";
open (han1, "$file") || die "error opening file: $!";
my @newrecords = ;
foreach (@newrecords) {
my @columns = split /:/;
my $username = $columns[0];
my $x = $columns[1];
my $userid = $columns[2];
my $groupid = $columns[3];
my $realname = $columns[4];
my $homedir = $columns[5];
my $shellpath = $columns[6];
#then u can echo the field that you want to disply
either u can do it throw a shell script and that will be good too
Code:
cat /etc/passwd | cut -d : -f "the field of the real name in the /etc/passwd file "