Mwnci getpwent() Function

Syntax

getpwent([string])

Description

The getpwent() function returns a hash for the given user name or Uid. If no argument is given then an array of hashes of each user entry is returned.

Example

include("pwd")
println(getpwent("root"))
println(getpwent(0))
println(getpwent())


{"Home": "/root", "Gecos": ["Rooty Root", "", "", ""], "User": "root", "Uid": 0, "Shell": "/bin/bash", "Gid": 0}
{"User": "root", "Uid": 0, "Gid": 0, "Gecos": ["Rooty Root", "", "", ""], "Home": "/root", "Shell": "/bin/bash"}
[{"Gid": 0, "Home": "/root", "Gecos": ["Rooty Root", "", "", ""], "User": "root", "Uid": 0, "Shell": "/bin/bash"}, {"Uid": 1, "Gecos": ["daemon"], "Gid": 1, "Home": "/usr/sbin", "Shell": "/usr/sbin/nologin", "User": "daemon"}, {"Gid": 2, "Home": "/bin", "Gecos": ["bin"], "User": "bin", "Uid": 2, "Shell": "/usr/sbin/nologin"}, {"Gid": 3, "User": "sys", "Gecos": ["sys"], "Home": "/dev", "Shell": "/usr/sbin/nologin", "Uid": 3}, {"User": "sync", "Gecos": ["sync"], "Uid": 4, "Gid": 65534, "Home": "/bin", "Shell": "/bin/sync"}, {"Uid": 5, "Gid": 60, "Shell": "/usr/sbin/nologin", "Home": "/usr/games", "Gecos": ["games"], "User": "games"}]