Write a program i.e. is a version of a shell that can take command(s) from the user and execute them on behalf of the user (by spawning a child process to execute the command on behalf of the parent process). It can only execute a few commands as listed below: [+] mkdir [ ... ] [+] ls [] [+] cp [+] mv [ ... ] [+] rm where parameters enclosed in [ ] are optional parameters. Note that multiple commands are recognized by the shell if each command is delimited by ";". These commands will be executed one after the other. Write a C program will act as a shell interface that should accept and execute each command in a separate process. There should be a parent process that will read the command and then the parent process will create a child process that will execute the command. The parent process should wait for the child process before continuing. Your program should mimic the Linux terminal. This program should be written in C and executed in Linux. You are required to implement five commands out of which one command should be the editor. The program design is entirely up to you but make sure that your shell interpreter is easy to modify.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a program i.e. is a version of a shell that can take command(s) from the user and execute them on behalf of the user (by spawning a child process to execute the command on behalf of the parent process). It can only execute a few commands as listed below:

[+] mkdir [ ... ]

[+] ls []

[+] cp

[+] mv [ ... ]

[+] rm

where parameters enclosed in [ ] are optional parameters. Note that multiple commands are recognized by the shell if each command is delimited by ";". These commands will be executed one after the other.

Write a C program will act as a shell interface that should accept and execute each command in a separate process. There should be a parent process that will read the command and then the parent process will create a child process that will execute the command. The parent process should wait for the child process before continuing. Your program should mimic the Linux terminal. This program should be written in C and executed in Linux. You are required to implement five commands out of which one command should be the editor. The program design is entirely up to you but make sure that your shell interpreter is easy to modify. 

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY