1
# passwd.awk --- access password file information
3
# Arnold Robbins, arnold@skeeve.com, Public Domain
6
# Revised December 2010
9
@namespace "foo" # this is foo
11
@namespace "bar" # this is bar
13
@namespace "passwd" # move to passwd namespace
16
# tailor this to suit your system
17
Awklib = "/usr/local/libexec/awk/"
20
function Init( oldfs, oldrs, olddol0, pwcat, using_fw, using_fpat)
28
using_fw = (PROCINFO["FS"] == "FIELDWIDTHS")
29
using_fpat = (PROCINFO["FS"] == "FPAT")
33
pwcat = Awklib "pwcat"
34
while ((pwcat | getline) > 0) {
44
FIELDWIDTHS = FIELDWIDTHS
51
function awk::getpwnam(name)
57
function awk::getpwuid(uid)
63
function awk::getpwent()
67
return Bycount[++Count]
71
function awk::endpwent()