/* $Id: netgr.c,v 1.1 2012/06/15 21:04:26 kostik Exp kostik $ */ #include #include int main(int argc, char *argv[]) { char *netgroup, *host, *user, *domain; int i; for (i = 1; i < argc; i++) { netgroup = argv[i]; printf("Processing %s\n", netgroup); setnetgrent(netgroup); while (getnetgrent(&host, &user, &domain)) { printf("\t %s %s %s\n", host ? host : "*", user ? user : "*" , domain ? domain : "*"); } } endnetgrent(); return (0); }