Write a mini shell program using the template code #define TRUE 1 while (TRUE) {
ID: 3833536 • Letter: W
Question
Write a mini shell program using the template code#define TRUE 1 while (TRUE) { type prompt( ); read command(command, parameters); if (fork( ) != 0) { /* Parent code. */ waitpid(1, &status, 0); } else { /* Child code. */ execve(command, parameters, 0); } } Write a mini shell program using the template code
#define TRUE 1 while (TRUE) { type prompt( ); read command(command, parameters); if (fork( ) != 0) { /* Parent code. */ waitpid(1, &status, 0); } else { /* Child code. */ execve(command, parameters, 0); } }
#define TRUE 1 while (TRUE) { type prompt( ); read command(command, parameters); if (fork( ) != 0) { /* Parent code. */ waitpid(1, &status, 0); } else { /* Child code. */ execve(command, parameters, 0); } } #define TRUE 1 while (TRUE) { type prompt( ); read command(command, parameters); if (fork( ) != 0) { /* Parent code. */ waitpid(1, &status, 0); } else { /* Child code. */ execve(command, parameters, 0); } }
Explanation / Answer
#include <string.h>
#include <sys/wait.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h>#include <string.h>
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.