xref: /csrg-svn/bin/rmdir/rmdir.c (revision 42540)
11085Sbill /*
235433Sbostic  * Copyright (c) 1983 The Regents of the University of California.
335433Sbostic  * All rights reserved.
435433Sbostic  *
5*42540Sbostic  * %sccs.include.redist.c%
619845Sdist  */
719845Sdist 
819845Sdist #ifndef lint
919845Sdist char copyright[] =
1035433Sbostic "@(#) Copyright (c) 1983 The Regents of the University of California.\n\
1119845Sdist  All rights reserved.\n";
1235433Sbostic #endif /* not lint */
1319845Sdist 
1419845Sdist #ifndef lint
15*42540Sbostic static char sccsid[] = "@(#)rmdir.c	5.3 (Berkeley) 05/31/90";
1635433Sbostic #endif /* not lint */
1719845Sdist 
1819845Sdist /*
191085Sbill  * Remove directory
201085Sbill  */
211085Sbill #include <stdio.h>
221085Sbill 
2335433Sbostic main(argc, argv)
249849Ssam 	int argc;
259849Ssam 	char **argv;
261085Sbill {
2735433Sbostic 	int errors;
281085Sbill 
299849Ssam 	if (argc < 2) {
3035433Sbostic 		fprintf(stderr, "usage: rmdir directory ...\n");
311085Sbill 		exit(1);
321085Sbill 	}
3335433Sbostic 	for (errors = 0; *++argv;)
3435433Sbostic 		if (rmdir(*argv) < 0) {
359850Ssam 			fprintf(stderr, "rmdir: ");
3635433Sbostic 			perror(*argv);
3735433Sbostic 			errors = 1;
389849Ssam 		}
3935433Sbostic 	exit(errors);
401085Sbill }
41