Question: C) Write a function called run_cmd which takes in a string and executes it (arguments are separated by single spaces). As well as the string

 C) Write a function called run_cmd which takes in a string

C) Write a function called run_cmd which takes in a string and executes it (arguments are separated by single spaces). As well as the string to run, it should also take pointers to two integers. These are the file descriptors for sending to the command and reading from the command respectively. So run_cmd("1s -1", &il, &i2) would run 1s with the argument "-1". If the string contains any '' characters, then each part should be executed separately and the standard output of the left program fed into the standard input of the right program. For example: run_cmd ("ls -1lsortlcat", &il, &i2) Note: there should be no spaces around ' void run-d(const char* d, int* to, int* from) { 9 marks C) Write a function called run_cmd which takes in a string and executes it (arguments are separated by single spaces). As well as the string to run, it should also take pointers to two integers. These are the file descriptors for sending to the command and reading from the command respectively. So run_cmd("1s -1", &il, &i2) would run 1s with the argument "-1". If the string contains any '' characters, then each part should be executed separately and the standard output of the left program fed into the standard input of the right program. For example: run_cmd ("ls -1lsortlcat", &il, &i2) Note: there should be no spaces around ' void run-d(const char* d, int* to, int* from) { 9 marks

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!