Answered step by step
Verified Expert Solution
Question
1 Approved Answer
if possible, at the end can you include pictures of you testing the program :) i would like to see the input and output so
if possible, at the end can you include pictures of you testing the program :)
I could use some help with making this program. Please please use the strucure at the bottom so that I can understand the program better. also please include the coding pieces listed below in order to get the program to work. The goal is to create a C program that repeatedly enters user input (interpreted as a shell command). The program should parse the command line to determine if it contains input/output redirection. For input from a file it is " " ". Then the command line should be executed in a forked child process by using an "exec" call. The program should provide a shell prompt that contains the current working directory followed by a " & ". If the current working directory changes, the prompt should be updated. Some pieces of code that should be used in the program are: - malloc and realloc - getenv - strdup - execvp for exec function - errno and strerror - \#define DEBUG // Functions de implement: char* CommandPrompt 0 ; // Display current working directory and return user input struct ShellCommand ParseCommandLine(chart input); // Process the user input (As a shell command) void ExecuteCommand(struct ShellCommand command); //Execute a shell command int main 0//MAIN \{ char* inpur, struct ShellCommand command; I/ npeatedly prompt the user for input for (i) \{ input = CommandPrompt 0 ; If parse the command line command = ParseCommandLinc(input); I/ exroute the command ExecuteCommand(command); exit(0) i would like to see the input and output so that i can make sure i get the same
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started