#include #include #include main() { int result; char prog[100]; printf( "\nWelcome to the Dshell...\n" ); printf( "Running as real UID %d and effective UID %d\n\n",getuid(),geteuid()); while (1) { printf("What executable should the child run? "); scanf( "%s", &prog); result = fork(); if ( result == 0 ) { execl(prog,prog,NULL); exit(0); } else { wait(NULL); printf("\n...done waiting. Welcome back!\n----------\n\n"); } } }