Commit | Line | Data |
---|---|---|
bcf1365c | 1 | /* |
e7e5aa72 KB |
2 | * Copyright (c) 1983 The Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms are permitted | |
6 | * provided that the above copyright notice and this paragraph are | |
7 | * duplicated in all such forms and that any documentation, | |
8 | * advertising materials, and other materials related to such | |
9 | * distribution and use acknowledge that the software was developed | |
10 | * by the University of California, Berkeley. The name of the | |
11 | * University may not be used to endorse or promote products derived | |
12 | * from this software without specific prior written permission. | |
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
bcf1365c DF |
16 | */ |
17 | ||
18 | #ifndef lint | |
19 | char copyright[] = | |
e7e5aa72 | 20 | "@(#) Copyright (c) 1983 The Regents of the University of California.\n\ |
bcf1365c | 21 | All rights reserved.\n"; |
e7e5aa72 | 22 | #endif /* not lint */ |
bcf1365c DF |
23 | |
24 | #ifndef lint | |
e7e5aa72 KB |
25 | static char sccsid[] = "@(#)rmdir.c 5.2 (Berkeley) %G%"; |
26 | #endif /* not lint */ | |
bcf1365c | 27 | |
ff487e30 BJ |
28 | /* |
29 | * Remove directory | |
30 | */ | |
ff487e30 BJ |
31 | #include <stdio.h> |
32 | ||
e7e5aa72 | 33 | main(argc, argv) |
a645d56b SL |
34 | int argc; |
35 | char **argv; | |
ff487e30 | 36 | { |
e7e5aa72 | 37 | int errors; |
ff487e30 | 38 | |
a645d56b | 39 | if (argc < 2) { |
e7e5aa72 | 40 | fprintf(stderr, "usage: rmdir directory ...\n"); |
ff487e30 BJ |
41 | exit(1); |
42 | } | |
e7e5aa72 KB |
43 | for (errors = 0; *++argv;) |
44 | if (rmdir(*argv) < 0) { | |
4738961c | 45 | fprintf(stderr, "rmdir: "); |
e7e5aa72 KB |
46 | perror(*argv); |
47 | errors = 1; | |
a645d56b | 48 | } |
e7e5aa72 | 49 | exit(errors); |
ff487e30 | 50 | } |