Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please show the code and output after running the code The output should look like this: Create a program in C that takes 2 Linux

image text in transcribed

Please show the code and output after running the code

The output should look like this:

image text in transcribed

Create a program in C that takes 2 Linux commands as command line arguments to your program, e.g., ls, cal. These commands should then run in different processes. For example, ls runs in the child process and cal runs in the parent process. In order to run Linux commands from your C program, you can use execvp (char * command, char *params []) function. To read more about it, type man execvp in terminal. Make sure to keep the following in mind: - Linux commands are passed as command line arguments to your program - At least 2 Linux commands should be provided through command line arguments - Both the commands should run in separate processes, e.g., Is runs in the child process and cal runs in the parent process. - Make sure to display process ID for both parent and child process. - Finally, make sure to complete the child process before parent process completes its execution. Look into \# include for more information on this

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Real Time Database Systems Architecture And Techniques

Authors: Kam-Yiu Lam ,Tei-Wei Kuo

1st Edition

1475784023, 978-1475784022

More Books

Students also viewed these Databases questions