[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getpwnam
From: |
Andreas Schwab |
Subject: |
Re: getpwnam |
Date: |
Thu, 01 Jan 2004 20:22:59 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) |
Bruce Korb <address@hidden> writes:
> Bob Proulx wrote:
>>
>> How would this relate to the existing 'getent' from glibc? There
>> appears to be a lot of overlap. But getent seems to be more general.
>>
>> getent passwd bob
>> bob:x:1000:1000:Bob Proulx,,,:/home/bob:/bin/bash
>
> 1. you cannot get it by user id,
Yes, you can.
> 2. you must still know that the comment is the 5th field, for example
> and parse the line. Thus, getent isn't any better than:
> egrep '^bob:' /etc/passwd
Of course it is, think of NIS, LDAP, etc.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- Re: getpwnam,
Andreas Schwab <=