* Copyright (c) 1988 The Regents of the University of California.
* %sccs.include.redist.c%
"@(#) Copyright (c) 1988 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)chroot.c 5.8 (Berkeley) %G%";
char *shell
, *getenv(), *strerror();
(void)fprintf(stderr
, "usage: chroot newroot [command]\n");
if (chdir(argv
[1]) || chroot("."))
execvp(argv
[2], &argv
[2]);
if (!(shell
= getenv("SHELL")))
execlp(shell
, shell
, "-i", (char *)NULL
);
(void)fprintf(stderr
, "chroot: %s: %s\n", msg
, strerror(errno
));