php网站怎么做post订单,成都市区必去的景点,公司个人怎么制作网站,专业的设计网站有哪些内容描述
此函数基于EXPR指定的用户名,从/etc/passwd文件提取的列表context中返回字段列表。通常这样使用-
($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) getpwnam($user);
在标量context中,返回数字用户ID。如果尝试访问整个/etc/passwd文件,则应使用getpwent…
描述
此函数基于EXPR指定的用户名,从/etc/passwd文件提取的列表context中返回字段列表。通常这样使用-
($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) getpwnam($user);
在标量context中,返回数字用户ID。如果尝试访问整个/etc/passwd文件,则应使用getpwent函数。如果要按用户ID访问详细信息,请使用getpwuid。
语法
以下是此函数的简单语法-
getpwnam EXPR返回值
此函数在标量context中返回用户ID,并在列表context中返回用户记录(名称,密码,用户ID,组ID,引用,注释,实名,主目录,shell)。
例
以下是显示其基本用法的示例代码-
#!/usr/bin/perl($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) getpwnam(root);
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;执行上述代码后,将产生以下输出-
Name root
Password x
UID 0
GID 0
Quota
Comment
Gcos root
HOME DIR /root
Shell /bin/bashPerl 中的 getpwnam函数 - 无涯教程网无涯教程网提供描述此函数基于EXPR指定的用户名,从/etc/passwd文件提取的列表context中返回字段列表...https://www.learnfk.com/perl/perl-getpwnam.html