programming-examples/perl/SystemFunction/Find all users without passwords.pl
2019-11-15 12:59:38 +01:00

19 lines
484 B
Raku

#!/usr/local/bin/perl -w
my $count = 1;
while (($account, $passwd, $uid, $gid, $quota, $comment, $gcos, $home, $shell) = getpwent()){
if ($passwd eq "" || $passwd eq "*")
{
write;
$count++;
}
}
format STDOUT_TOP=
Count Account UID GID Home
.
format STDOUT=
@>>>> @<<<<<<<<<<<<<< @<<<<< @<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$count,$account,$uid,$gid,$home