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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post by answerhappygod »

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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply