Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions