diff --git a/labs/03/README.md b/labs/03/README.md index 51d53a5a..2c25a937 100644 --- a/labs/03/README.md +++ b/labs/03/README.md @@ -18,7 +18,7 @@ language. At the end of the practice students will understand * Clone the repository * Go to operating-systems-lecture/labs/03 -* Reading the examples from operating-systems-lecture/labs/03 create a terminal +* Reading the examples from operating-systems-lecture/labs/03/Terminal * git commit -s -m 'ITESMID-homework-03' * git send-mail -1 diff --git a/labs/03/Terminal b/labs/03/Terminal new file mode 100644 index 00000000..dac57a35 --- /dev/null +++ b/labs/03/Terminal @@ -0,0 +1,165 @@ +//Tarea Terminal +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SHMSZ 10 + +void server(char[10]); +void client(pid_t); + +int main(){ + pid_t pid; + char op[10], st[10]; + printf(" BIENVENIDO A LA TERMINAL\n"); + printf("Los comandos que puede ejecutar son los siguientes: ls, pwd, date, exit\n"); + + //Terminal visual space + while(strcmp(st, "exit") != 0){ + printf(">> "); + fgets(op,10,stdin); + for(int i=0; i