Question: write a program that creates a simple shell that takes multiple commands from user to perform tasks. The program should use pipe to detect the

write a program that creates a simple shell that takes multiple commands from user to perform tasks. The program should use pipe to detect the "|" symbol to combine multiple commands together.

System call needed for the program: execvp, fork, dup2

Example:

the "ls" command lists all the files in the directory.

use "ls | wc -l" counts the number of files in the directory.

Note: the above example only uses two pipes but your program should work with multiple pipes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!