Answered step by step
Verified Expert Solution
Link Copied!

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 would like to see the input and output so that i can make sure i get the same
image text in transcribed
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)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions