xref: /csrg-svn/bin/rmdir/rmdir.c (revision 19845)
11085Sbill /*
2*19845Sdist  * Copyright (c) 1983 Regents of the University of California.
3*19845Sdist  * All rights reserved.  The Berkeley software License Agreement
4*19845Sdist  * specifies the terms and conditions for redistribution.
5*19845Sdist  */
6*19845Sdist 
7*19845Sdist #ifndef lint
8*19845Sdist char copyright[] =
9*19845Sdist "@(#) Copyright (c) 1983 Regents of the University of California.\n\
10*19845Sdist  All rights reserved.\n";
11*19845Sdist #endif not lint
12*19845Sdist 
13*19845Sdist #ifndef lint
14*19845Sdist static char sccsid[] = "@(#)rmdir.c	5.1 (Berkeley) 04/30/85";
15*19845Sdist #endif not lint
16*19845Sdist 
17*19845Sdist /*
181085Sbill  * Remove directory
191085Sbill  */
201085Sbill #include <stdio.h>
211085Sbill 
221085Sbill main(argc,argv)
239849Ssam 	int argc;
249849Ssam 	char **argv;
251085Sbill {
269849Ssam 	int errors = 0;
271085Sbill 
289849Ssam 	if (argc < 2) {
2917887Sserge 		fprintf(stderr, "usage: %s directory ...\n", argv[0]);
301085Sbill 		exit(1);
311085Sbill 	}
329849Ssam 	while (--argc)
339849Ssam 		if (rmdir(*++argv) < 0) {
349850Ssam 			fprintf(stderr, "rmdir: ");
359849Ssam 			perror(*argv);;
369849Ssam 			errors++;
379849Ssam 		}
389849Ssam 	exit(errors != 0);
391085Sbill }
40