Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Practica Shell
Practica Shell
h"
while (1) {
printf("-");
fgets(texto,1024,stdin);
printf("\n");
comprueba(texto, argv);
for(i = 0; argv[0][i]; i++)
argv[0][i] = tolower(argv[0][i]);
i = 0;
if (strcmp(argv[0], "exit") == 0)
exit(0);
lanzar(argv);
}
}
while (*texto == ' ' || *texto == '\t' || *texto == '\n' || *texto == '&'){
*texto++ = '\0';
if(*texto == '&')otro = false;
}
*argv++ = texto;
while (*texto != '\0' && *texto != ' ' && *texto != '\t' && *texto !=
'\n'&& *texto != '&')
texto++;
}
*argv = '\0';
}
if ( otro == true) {
wait(&status) != pid;
}else{
printf ( "PID: %d\n", getpid());
otro = true;
}