home *** CD-ROM | disk | FTP | other *** search
- /* vi:tabstop=4:shiftwidth=4:smartindent
- *
- * exec.c - replace this shell with the named command
- *
- */
-
- #include <stdio.h>
- #include <history.h>
- #include <unistd.h>
- #include "psh.h"
-
- int sh_exec(int argc, char **argv)
- {
- if (argc > 1)
- {
- /* Write out the history list before execvp
- */
- write_history(NULL);
- execvp("*", argv);
- }
- else
- {
- fprintf(stderr, "No command to exec\n");
- return 1;
- }
- return 0;
- }
-