getpwent
getpwent
各ユーザの以下の情報を返します。スカラーコンテキストではユーザ名を返します。
WindowsXP + Active Perlでは使えませんでした。
| 1 | ユーザ名 |
| 2 | ユーザのパスワード |
| 3 | ユーザID |
| 4 | グループID |
| 5 | quota |
| 6 | コメント |
| 7 | 本名 |
| 8 | ホームディレクトリ |
| 9 | シェルプログラム |
サンプルプログラム
use strict;
while (my @ent = getpwent) {
my ($name, $password, $uid, $gid, $quota, $comment, $gcos, $dir, $shell)
= @ent;
printf "%s,%s,%s,%s,%s,%s,%s,%s,%s\n",
$name, $password, $uid, $gid, $quota, $comment, $gcos, $dir, $shell;
}
関連項目
・getpwnam関数・getpwuid関数
