File: groups

package info (click to toggle)
bup 0.33.9-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,712 kB
  • sloc: python: 15,897; sh: 5,764; ansic: 2,965; pascal: 669; makefile: 21
file content (15 lines) | stat: -rwxr-xr-x 285 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
"""": # -*-python-*-
python="$(dirname "$0")/python" || exit $?
exec "$python" "$0" ${1+"$@"}
"""

import grp, os

# cf. helpers.getgroups()
egid = os.getegid()
gids = os.getgroups()
if egid not in gids:
    gids.append(egid)

print(*[grp.getgrgid(x).gr_name for x in gids])