2 * getfullname.c - Extract a user's name out of the GECOS field in
5 * This code is Copyright (c) 2012, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
13 #include <sys/types.h>
17 main(int argc, char *argv[])
20 fprintf (stderr, "usage: %s\n", argv[0]);
25 pwd = getpwuid(getuid());
28 fprintf(stderr, "Unable to retrieve user info for "
29 "userid %d\n", getuid());
33 printf("%s\n", pwd->pw_gecos);