On Mon, Sep 06 at 01:53, jr wrote:
> hi Ralph,
> 
> > ? ?$ ? ? awk -F: '$1 == "root" || $3 ~ /^0*$/ {print NR, $0}' /etc/group
> > ? ?1 root:x:0:
> 
> just wondering why the last field's empty (and doesn't contain user 'root')?
> 
> man (5) group specifies:  group_name:passwd:GID:user_list

It's a common ommission/non-requirement.

All users (root included) get their primary group ID from /etc/passwd,
it's the numeric value 4th field.  /etc/group is really about providing
a number/name translation for group IDs and setting the user's supplementary
group IDs.

The fact that a user's primary GID may or may not be in the supplementary
group list is just one of those little pains you have to program around.


If you enjoyed man (5) group you may also like to try man (7) credentials.

-- 
        Bob Dunlop

--
Next meeting:  Blandford Forum, Tuesday 2010-09-07 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://bit.ly/4sACa

Reply via email to