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;