starting work on chgrp
This commit is contained in:
parent
9a942a2125
commit
5bb1bf93a0
1 changed files with 21 additions and 0 deletions
21
chgrp.c
Normal file
21
chgrp.c
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue