#include #include #include #include #include static void execute (char *tb[]) { int pid; int status; int i; printf ("Executing "); for (i=0; tb[i] != NULL; i++) printf (" %s",tb[i]); printf ("\n"); pid = fork(); if (pid == 0){ execv (tb[0],tb); } wait (&status); } int main (int argc, char *argv[]) { FILE *fin; int i; extern char **environ; int fd = open ("/dev/tty1",O_RDWR); if (fd != -1){ dup2 (fd,0); dup2 (fd,1); dup2 (fd,2); } for (i=0; i ' ') pt++; if (*pt == '\0') break; *pt++ = '\0'; } } if (no > 1){ args[no] = NULL; execute (args); } } } { static char *tb[]={ "/bin/umount", "/proc", NULL }; execute (tb); } return 0; }