Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The purpose of this lab is to write a simple shell program. Your shell program should use the same style as the Bourne shell for
The purpose of this lab is to write a simple shell program. Your shell program should use the same style as the Bourne shell for running programs. In particular, when the user types a line such as: command [identifier[identifier]] your shell should parse the command line to build argv. Use the execvp() system call to execute the file that contains the command. This way the exec() will search the PATH directory paths automatically. The shell must also interpret the "&" operator as a command terminator. A command terminated with "&" should be executed concurrently with the shell rather than the shell waiting for the command to terminate before it prompts the user for another command (background execution) If a command is given that execvp() cannot execute (such as an erroneous command), an appropriate error message must be outputted and the shell should be reprompted Your program should terminate once the AC signal is used or when the user types in "exit. The purpose of this lab is to write a simple shell program. Your shell program should use the same style as the Bourne shell for running programs. In particular, when the user types a line such as: command [identifier[identifier]] your shell should parse the command line to build argv. Use the execvp() system call to execute the file that contains the command. This way the exec() will search the PATH directory paths automatically. The shell must also interpret the "&" operator as a command terminator. A command terminated with "&" should be executed concurrently with the shell rather than the shell waiting for the command to terminate before it prompts the user for another command (background execution) If a command is given that execvp() cannot execute (such as an erroneous command), an appropriate error message must be outputted and the shell should be reprompted Your program should terminate once the AC signal is used or when the user types in "exit
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