[Webfunds-devel] Re: [Webfunds-commits] scripts ricardian_keys

Edwin Woudt edwin@woudt.nl
Wed, 23 Aug 2000 21:27:28 +0200


--On 08/23/00 13:34:22 -0400 Ian Grigg <iang@systemics.com> wrote:

>> > id=$(sed -e /${pw}/'!d' -e s/.*${pw}// -e s/:.*// < /etc/passwd)
>>
>> Why does a script like this need to access /etc/passwd ?
>
> This reads the password file in order to extract out the
> full name of the user.  There may be a nicer way, but I
> cannot recall if there is.
>
> In short, the sed reads the password file, deletes all
> lines that don't match the uid/gid combination, and then
> extracts the field after that.  It could be done more
> accurately, for example with awk(1) but I don't use that
> myself.


Dumb question, but uhm... why does the script care what my username is?


Edwin