home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl
-
- # a report on the /etc/passwd file
- format top =
- Passwd File
- Name Login Office Uid Gid Home
- ---------------------------------------------------------------
- .
- format STDOUT =
- @<<<<<<<<<<<<<<<<<< @||||||| @<<<<<<@>>>> @>>>> @<<<<<<<<<<<<<<
- $name, $login, $office,$uid,$gid, $home
- .
-
- open(PASSWD, "/etc/passwd") || die "Can't open passwd: $!\n";
- while (<PASSWD>) {
- chop;
- ($login,$passwd,$uid,$gid,$gcos,$home,$shell) = split(/:/);
- ($name,$office,$phone) = split(/,/,$gcos); # (BSD specific!)
- write;
- }
-