~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to awklib/eg/lib/pwcat.c

  • Committer: Arnold D. Robbins
  • Date: 2010-07-16 09:41:09 UTC
  • Revision ID: git-v1:8c042f99cc7465c86351d21331a129111b75345d
Tags: gawk-3.0.0
Move to gawk-3.0.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * pwcat.c
 
3
 *
 
4
 * Generate a printable version of the password database
 
5
 *
 
6
 * Arnold Robbins
 
7
 * arnold@gnu.ai.mit.edu
 
8
 * May 1993
 
9
 * Public Domain
 
10
 */
 
11
 
 
12
#include <stdio.h>
 
13
#include <pwd.h>
 
14
 
 
15
int
 
16
main(argc, argv)
 
17
int argc;
 
18
char **argv;
 
19
{
 
20
    struct passwd *p;
 
21
 
 
22
    while ((p = getpwent()) != NULL)
 
23
        printf("%s:%s:%d:%d:%s:%s:%s\n",
 
24
            p->pw_name, p->pw_passwd, p->pw_uid,
 
25
            p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell);
 
26
 
 
27
    endpwent();
 
28
    exit(0);
 
29
}