Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is the the code that you need to work with #include #include #include #define MAX_CMN_LEN 100 int main(int argc, char *argv[]) { char cmd[MAX_CMN_LEN]
this is the the code that you need to work with
#include #include #include
#define MAX_CMN_LEN 100
int main(int argc, char *argv[]) { char cmd[MAX_CMN_LEN] = "", **p;
if (argc
return 0; }
how to run programm:-
1). open up a terminal and compile the program
2). run it (for example in Ubuntu) ./program_name comman_name -anything - anything
example: ./a.out ls
Output:- It will print all current directory folder and file name.
(redirecting output using dup or dup2) Add to the MoreShell ability to execute command lines with commands connected by pipes. Use dup2 or dup system call to redirect IO Example: Is -1 | wc . (DupShell.c DupShell)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started