Question: How to implement these 2 features in C? Its shell script in C. Starter code provided. Use the corresponding system call. Starter code: Concepts: Command-line

How to implement these 2 features in C? Its shell script in C. Starter code provided. Use the corresponding system call.

How to implement these 2 features in C? Its shell script in

C. Starter code provided. Use the corresponding system call. Starter code: Concepts:

Starter code:

Command-line parameters System calls: fork(), execvp), wait0 #include unistd.h> #include #include errno.h

Concepts: Command-line parameters System calls: fork(), execvp), wait0 #include unistd.h> #include #include errno.h #include #include types.h> #include #include #include extern char ** get args); int main() int char 1 args; while (1) printf ("Command ('exit' to quit): "); args-get_args(O; for (= 0; args [i] != NULL ; i++) { printf ("Argument %d : %s ", i, args[i]); printf ("No arguments on line! "); printf ("Exiting...In"); if (args [0] = NULL) { else if !strcmp (args [0], "exit") break

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!