/* * chgrp gid file ... */ #include #include #include #include #include struct group *gr,*getgrnam(); struct stat stbuf; int gid; int status; main(argc, argv) char *argv[]; { register c; if(argc < 3) { printf("usage: chgrp gid file ...\n"); exit(4); } if(isnumber(argv[1])) { gid = atoi(argv[1]); } else { if((gr=getgrnam(argv[1])) == NULL) { printf("unknown group: %s\n",argv[1]); exit(4); } gid = gr->gr_gid; } for(c=2; c