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
Get step-by-step solutions from verified subject matter experts
