1 |
В Tue, 15 Apr 2014 12:06:44 +0400 |
2 |
Alexander Tsoy <alexander@××××.me> пишет: |
3 |
|
4 |
> В Tue, 15 Apr 2014 11:11:53 +0900 |
5 |
> Naohiro Aota <naota@g.o> пишет: |
6 |
> |
7 |
> > Diego Elio Pettenò <flameeyes@×××××××××.eu> writes: |
8 |
> > |
9 |
> > > I'm pretty sure we have an eclass function to get the name of the |
10 |
> > > 0 group. |
11 |
> > |
12 |
> > I can't find one... but found qmail.eclass is using exactly same |
13 |
> > method. |
14 |
> > |
15 |
> > > export GROUP_ROOT="$(id -gn root)" |
16 |
> |
17 |
> "id -gn root" prints initial group name of the user root. This is |
18 |
> exactly what you want in fcaps.eclass. In linux "id" accepts only |
19 |
> username as argument, it doesn't support uid. |
20 |
> |
21 |
|
22 |
But if you really want to convert gid=0 to groupname, then use egetent() |
23 |
as also noted by Cyprien: |
24 |
|
25 |
inherit user |
26 |
... |
27 |
local group=$(egetent group 0) |
28 |
group=${group%%:*} |
29 |
|
30 |
-- |
31 |
Alexander Tsoy |