|
ユーザ情報の一覧を出力するCGIです。 …とはいえ、iswebの環境では、ホンモノの情報は得られませんが…。 動作例
ここを押すと、実行結果がわかります。↓ ソースコード
#!/usr/local/bin/perl
use CGI;
use strict;
my $cgi = new CGI;
print $cgi->header, $cgi->start_html('Hello World');
print "<p><table border=\"1\">\n";
print "<tr><th>Name</th><th>Uid</th><th>Gid</th>";
print "<th>Gcos</th><th>Home</th><th>Shell</th></tr>\n";
my @pwent;
setpwent();
while(@pwent = getpwent()) {
print "<tr><td>$pwent[0]</td><td>$pwent[2]</td><td>$pwent[3]</td>";
print "<td>$pwent[6]</td><td>$pwent[7]</td><td>$pwent[8]</td></tr>\n";
}
endpwent();
print "</table></p>\n";
print $cgi->end_html;
|
▼ 個人的宣伝
|