#!/usr/bin/perl # # yes, this is a perl script. rename it to foo.pl to use it. # @users = `ypcat passwd`; # get the list of usernames and realnames # this could be /etc/passwd, or something you type in if you want # this is the guts of the postscript dictionary downloader $header= <userheader.ps"); #open the header for writing print FILE ($header); $users=@users; # set $users to the number of items in @users $i=0; while ( $i < $users ) { # while the counter is lower than the number of users @user= split(':',$users[$i]); # split each line of the passwd file into fields $uid=$user[0]; # the first field is the userid $gcos=$user[4]; # the fifth field is the real name $gcos =~ s/,.*//; # get rid of anything after the first comma, like office and phone number print FILE ("\(", $uid, "\) \(", $gcos, "\) \n"); # print it $i ++; # update the counter } print FILE (">> begin } def put\n"); # the last bit of the postscript file close FILE;