[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
proposed new program: getpwnam [Re: --format flag
From: |
Jim Meyering |
Subject: |
proposed new program: getpwnam [Re: --format flag |
Date: |
Thu, 18 Dec 2003 10:00:40 +0100 |
Bruce Korb <address@hidden> wrote:
> So, what do you think about adding POSIX library/sys calls as
> a collection of command line utilities? We already have "stat",
> but don't have "getpwnam". There are a few others.....
I hesitate to add new tools that can be approximated with
one-liners using e.g Perl
$ perl -MUser::pwent -e '$pw=getpwnam "root" or die; print $pw->shell,"\n"'
/bin/bash
[ Coreutils should come with a collection of useful one-liners,
shell functions/aliases, and little scripts. But someone would
have to collect and document them. Volunteers? ]
But `getpwnam --shell root' is certainly easier to type. And
as a real program, it'd be able to produce better (including
internationalized) diagnostics and do better error checking --
e.g. via closeout.c's close_stdout.
So, in this case it's probably worth it. I do like the idea of a
getpwnam command, but am not sure that should be the name of the command.
Obviously it's a good name from the consistency-with-library-name
standpoint, but its mangled name is sort of reminiscent of `creat'.
Suggested alternatives welcome.
Would you be interested in converting your program to use the same
sort of framework that's used in the other 90 programs in coreutils?
And documenting it?