1 /* 2 * Copyright (c) 1983 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 char copyright[] = 10 "@(#) Copyright (c) 1983 The Regents of the University of California.\n\ 11 All rights reserved.\n"; 12 #endif /* not lint */ 13 14 #ifndef lint 15 static char sccsid[] = "@(#)rmdir.c 5.3 (Berkeley) 05/31/90"; 16 #endif /* not lint */ 17 18 /* 19 * Remove directory 20 */ 21 #include <stdio.h> 22 23 main(argc, argv) 24 int argc; 25 char **argv; 26 { 27 int errors; 28 29 if (argc < 2) { 30 fprintf(stderr, "usage: rmdir directory ...\n"); 31 exit(1); 32 } 33 for (errors = 0; *++argv;) 34 if (rmdir(*argv) < 0) { 35 fprintf(stderr, "rmdir: "); 36 perror(*argv); 37 errors = 1; 38 } 39 exit(errors); 40 } 41