13 struct passwd *my_passwd;
14 struct group *my_group;
18 my_passwd = getpwuid (me);
20 printf ("My login name is %s.\n", my_passwd->pw_name);
21 printf ("My uid is %d.\n", (int)(my_passwd->pw_uid));
22 printf ("My home directory is %s.\n", my_passwd->pw_dir);
23 printf ("My default shell is %s.\n", my_passwd->pw_shell);
25 my_group = getgrgid (my_passwd->pw_gid);
27 printf ("Couldn't find out about group %d.\n", (int)(my_passwd->pw_gid));
31 printf ("My default group is %s (%d).\n",
32 my_group->gr_name, (int)(my_passwd->pw_gid));
33 printf ("The members of this group are:\n");
34 for (members = my_group->gr_mem; *members != NULL; ++members)
35 printf (" %s\n", *members);