xref: /csrg-svn/sys/i386/floppy/mv/mv.c (revision 63347)
149547Sbostic /*-
2*63347Sbostic  * Copyright (c) 1991, 1993
3*63347Sbostic  *	The Regents of the University of California.  All rights reserved.
449547Sbostic  *
549547Sbostic  * %sccs.include.redist.c%
649554Sbostic  *
7*63347Sbostic  *	@(#)mv.c	8.1 (Berkeley) 06/11/93
849547Sbostic  */
949547Sbostic 
1049547Sbostic int eval;
1149547Sbostic 
main(argc,argv)1249547Sbostic main(argc, argv)
1349547Sbostic 	int argc;
1449547Sbostic 	char **argv;
1549547Sbostic {
1649547Sbostic 	if (*++argv && **argv == '-') {
1749547Sbostic 		err("no options available", 0);
1849547Sbostic 		_exit(1);
1949547Sbostic 	}
2049547Sbostic 	if (argc != 3) {
2149547Sbostic 		err("usage: mv file1 file2", 0);
2249547Sbostic 		_exit(1);
2349547Sbostic 	}
2449547Sbostic 	if (rename(argv[0], argv[1])) {
2549547Sbostic 		err(argv[1], 1);
2649547Sbostic 		_exit(1);
2749547Sbostic 	}
2849547Sbostic 	_exit(0);
2949547Sbostic }
3049547Sbostic 
3149547Sbostic #define	PROGNAME	"mv: "
3249547Sbostic #include "errfunction"
33