Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a closh (Clone Shell) designed to run multiple copies of a program at once. Closh takes as input the name of the program to

Implement a closh (Clone Shell) designed to run multiple copies of a program at once.

Closh takes as input the name of the program to run, the number of copies (processes) of the program to run - an integer from 1 to 9 and whether the processes should execute concurrently or sequentially.

Closh executes the given program the specified number of times, then returns to the prompt once all processes have either completed or timed out. The shell should be written in C++. Use execlp() to create a new child process and have it execute a command and waitpid in the parent process to wait for the child process to finish in case sequential execution is selected.

Here is a simple example of using closh (bold is program output, italic is user input):

./closh

closh> ./hello.exe

count> 3

[p]arallel or [s]equential> p

hello world

hello world

hello world

closh>

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

=+What is the extent of the use of each type of IE?

Answered: 1 week ago