xref: /csrg-svn/bin/rmdir/rmdir.c (revision 35433)
11085Sbill /*
2*35433Sbostic  * Copyright (c) 1983 The Regents of the University of California.
3*35433Sbostic  * All rights reserved.
4*35433Sbostic  *
5*35433Sbostic  * Redistribution and use in source and binary forms are permitted
6*35433Sbostic  * provided that the above copyright notice and this paragraph are
7*35433Sbostic  * duplicated in all such forms and that any documentation,
8*35433Sbostic  * advertising materials, and other materials related to such
9*35433Sbostic  * distribution and use acknowledge that the software was developed
10*35433Sbostic  * by the University of California, Berkeley.  The name of the
11*35433Sbostic  * University may not be used to endorse or promote products derived
12*35433Sbostic  * from this software without specific prior written permission.
13*35433Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*35433Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*35433Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1619845Sdist  */
1719845Sdist 
1819845Sdist #ifndef lint
1919845Sdist char copyright[] =
20*35433Sbostic "@(#) Copyright (c) 1983 The Regents of the University of California.\n\
2119845Sdist  All rights reserved.\n";
22*35433Sbostic #endif /* not lint */
2319845Sdist 
2419845Sdist #ifndef lint
25*35433Sbostic static char sccsid[] = "@(#)rmdir.c	5.2 (Berkeley) 08/30/88";
26*35433Sbostic #endif /* not lint */
2719845Sdist 
2819845Sdist /*
291085Sbill  * Remove directory
301085Sbill  */
311085Sbill #include <stdio.h>
321085Sbill 
33*35433Sbostic main(argc, argv)
349849Ssam 	int argc;
359849Ssam 	char **argv;
361085Sbill {
37*35433Sbostic 	int errors;
381085Sbill 
399849Ssam 	if (argc < 2) {
40*35433Sbostic 		fprintf(stderr, "usage: rmdir directory ...\n");
411085Sbill 		exit(1);
421085Sbill 	}
43*35433Sbostic 	for (errors = 0; *++argv;)
44*35433Sbostic 		if (rmdir(*argv) < 0) {
459850Ssam 			fprintf(stderr, "rmdir: ");
46*35433Sbostic 			perror(*argv);
47*35433Sbostic 			errors = 1;
489849Ssam 		}
49*35433Sbostic 	exit(errors);
501085Sbill }
51