starting work on chgrp

This commit is contained in:
Gitea 2020-12-12 01:58:36 -06:00
parent 9a942a2125
commit 5bb1bf93a0

21
chgrp.c Normal file
View file

@ -0,0 +1,21 @@
#define _POSIX_C_SOURCE 200809L
#include <unistd.h>
int main(int argc, char * argv[]) {
char c;
int recurse = 0; /* -R */
/* 0: -P, 01: -L, 02: -H */
int recurse_follow = 0;
int follow_link = 0; /* -h */
while((c = getopt(argc, argv, "RHLPh")) != -1) {
switch(c) {
case 'R': recurse = 1; break;
case 'P': recurse_follow = 0; break;
case 'L': recurse_follow = 01; break;
case 'H': recurse_follow = 02; break;
case 'h': follow_link = 1; break;
}
}
}