Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone do it asap In this assignment, you will write a complete C program that will act as a simple command-line interpreter (i.e., a

image text in transcribed can someone do it asap

In this assignment, you will write a complete C program that will act as a simple command-line interpreter (i.e., a shell) for the Linux kernel. In writing your shell, you are expected to use the fork-exec-wait model discussed in class. In particular, you are to implement the following: Loop continuously until the user enters quit, which exits your shell Inside the loop, you will print your "minor5" prompt and read in the user's command, which may consist of a Linux command with 0 or more options and arguments supported by the command. You are expected to read in and process only 1 command at a time with no pipelining or redirection. . In a child process, you are to execute the command as given, including all options and arguments given. If the command is not valid, rather than display an "exec failed" message as shown in class examples, you will simply print out the command itself with "command not found" as shown inthe SAMPLE OUTPUT and then exit the child process. The parent process should wait for the child process to finish If you have any questions about this, please contact your instructor, TAs, or lAs assigned to this course to ensure you understand these directions SAMPLE OUTPUT (user input shown in bold): $ ./a.out minor5 ls a out du.txt rec01.c minor5 ls-a -l -t total 144 -rwx--_1 mat0299 mat0299 7835 Oct 14 17:39 a.out drwx----4 mat0299 mat0299 4096 Oct 14 17:39 -rw---1 mat0299 mat0299 2665 Oct 14 17:39 minor5.c -rw----1 mat0299 mat0299 33 Oct 5 03:30 du.txt -rw---1 mat0299 mat0299 33 Oct 5 01:28 filel -rw---1 mat0299 mat0299 333 Oct 5 01:02 route.txt drwx--2 mat0299 mat0299 4096 Oct 3 20:36 testdir -rw--1 mat0299 mat0299 116 Oct 2 23:38 who.txt grades.txt rec01.txt testdir filel phone.txt route.txt ho.txt rec01sol.c minor5.c IW--_ rw--1mat0299 mat029952 Sep 24 11:15 phone.txt -rw-1 mat0299 mat0299 200 Sep 19 02:37 grades.txt -IW -rw--1 mat0299 mat0299 160 Sep 2 14:58 rec01.txt - 1 mat0299 mat0299 1634 Sep 2 15:08 rec01.c - 1 mat0299 mat0299 1451 Sep 2 14:58 rec0lsol.c 18 mat0299 mat0299 4096 Aug 12 21:04 .. minor5> ls -alt

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

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

4. Show the trainees how to do it again.

Answered: 1 week ago