Problem
1
C++
Write a C++ program
that does the following:
ls -a
-l
then
cmd is "ls" and params is "-a -l".
Problem
2
This problem builds
significantly on the previous problem. Specifically, it asks you to
again use fork() to create processes and exec() (or one of the many
variants) to assign the newly created processes what to do. In
addition, however, it asks you to mimic the behavior of a shell
command such as
ls |
wc
What happens in the
case above is the output of the first command ('ls') becomes the
input to the second command ('wc'). (Try it in a terminal on a Unix
machine).
Thus, you are required
to write another program that:
Please don't copy from other answers solutions
Problem 1 C++ Write a C++ program that does the following: ls -a -l then cmd is "ls" and params is "-a -l". Problem 2 Th
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am