endpwent |
让你的系统不再期望使用getpwent从密码文件中读取条目。 在Windows下,使用的Win32API:: Net函数,从域名服务器得到的信息。
None
试试下面的例子:
#!/usr/bin/perl
while(($name, $passwd, $uid, $gid, $quota,
$comment, $gcos, $dir, $shell) = getpwent()){
print "Name = $name\n";
print "Password = $passwd\n";
print "UID = $uid\n";
print "GID = $gid\n";
print "Quota = $quota\n";
print "Comment = $comment\n";
print "Gcos = $gcos\n";
print "HOME DIR = $dir\n";
print "Shell = $shell\n";
}
setpwent() ; # Rewind the databse /etc/passwd
while(($name, $passwd, $uid, $gid, $quota,
$comment, $gcos, $dir, $shell) = getpwent()){
print "Name = $name\n";
print "Password = $passwd\n";
print "UID = $uid\n";
print "GID = $gid\n";
print "Quota = $quota\n";
print "Comment = $comment\n";
print "Gcos = $gcos\n";
print "HOME DIR = $dir\n";
print "Shell = $shell\n";
}
#by www.gitbook.net
endpwent(); # Closes the database;