Jim Meyering wrote: > Bruce Korb 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 I will use two commands but I think this is simpler. getent passwd bob | awk -F: '{print$NF}' /bin/bash Obviously you can pick out whatever field you need using this. > 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. 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 getent aliases root root: bob getent hosts 127.0.0.1 127.0.0.1 torment.proulx.com torment localhost getent services ssh ssh 22/tcp Of course other systems like HP-UX don't have glibc and also don't have 'getent' either because of this. Personally I would rather see getent in coreutils so that it would be available on all of the platforms that coreutils is available. And of course a getpwnam in coreutils would be nice for similar reasons. Bob _______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-coreutils