#include #include #include #include #include #include #include int main() { int ans; int ret; char **argv; char *temp; char command[100]; argv = malloc(sizeof(char)*2); printf("\n****** My shell starts here ******\n"); printf("\n"); printf("myBash$> "); char **enviro = '\0'; while(1) { /*Read command and other agruments from stdin*/ fgets(command,100,stdin); temp = (argv[0] = strtok(command," \t\n")); if(temp != NULL) { /*if input is exit*/ if(strcmp("exit",argv[0]) == 0) { break; } execve("/bin/ls",argv,enviro); } printf("myBash$> "); } return 0; }