Answered step by step
Verified Expert Solution
Link Copied!

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]

image text in transcribed

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

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions