b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / share / awk /
Filename/usr/share/awk/group.awk
Size1.77 kb
Permissionrw-r--r--
Ownerapache
Create time26-May-2024 11:05
Last modified10-Nov-2015 15:01
Last accessed10-Nov-2015 15:01
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
# group.awk --- functions for dealing with the group file
#
# Arnold Robbins, [email protected], Public Domain
# May 1993
# Revised October 2000

BEGIN \
{
# Change to suit your system
_gr_awklib = "/usr/libexec/awk/"
}

function _gr_init( oldfs, oldrs, olddol0, grcat,
using_fw, n, a, i)
{
if (_gr_inited)
return

oldfs = FS
oldrs = RS
olddol0 = $0
using_fw = (PROCINFO["FS"] == "FIELDWIDTHS")
FS = ":"
RS = "\n"

grcat = _gr_awklib "grcat"
while ((grcat | getline) > 0) {
if ($1 in _gr_byname)
_gr_byname[$1] = _gr_byname[$1] "," $4
else
_gr_byname[$1] = $0
if ($3 in _gr_bygid)
_gr_bygid[$3] = _gr_bygid[$3] "," $4
else
_gr_bygid[$3] = $0

n = split($4, a, "[ \t]*,[ \t]*")
for (i = 1; i <= n; i++)
if (a[i] in _gr_groupsbyuser)
_gr_groupsbyuser[a[i]] = \
_gr_groupsbyuser[a[i]] " " $1
else
_gr_groupsbyuser[a[i]] = $1

_gr_bycount[++_gr_count] = $0
}
close(grcat)
_gr_count = 0
_gr_inited++
FS = oldfs
if (using_fw)
FIELDWIDTHS = FIELDWIDTHS
RS = oldrs
$0 = olddol0
}
function getgrnam(group)
{
_gr_init()
if (group in _gr_byname)
return _gr_byname[group]
return ""
}
function getgrgid(gid)
{
_gr_init()
if (gid in _gr_bygid)
return _gr_bygid[gid]
return ""
}
function getgruser(user)
{
_gr_init()
if (user in _gr_groupsbyuser)
return _gr_groupsbyuser[user]
return ""
}
function getgrent()
{
_gr_init()
if (++_gr_count in _gr_bycount)
return _gr_bycount[_gr_count]
return ""
}
function endgrent()
{
_gr_count = 0
}