Accept commands from the user, Computer Engineering

Assignment Help:

Your shell must accept commands from the user. The first step to implement this will be reading a line of input. This section will focus on what to do with the line of input after it is read. A command will consist of the name or path to the command, followed by zero or more arguments separated by white spaces. For this assignment, we will define white space as one or more space characters. Here is an example of a command with arguments:

l s  - a l

In this argument _ls_ will be the command and _-al_ is the first and only argument. To allow proper formatting the commands, we will put these commands into an array of char*. So, the first element of the array should be _ls_, and the second element should be _-al_. To parse the commands, we suggest using the strtok function from string.h. You can use just a space (" ") as the lone delimiter. Remember to consider the case where the user does not enter any command and hits the enter key. Your shell should simply print the prompt again on a new line.


Related Discussions:- Accept commands from the user

Define seek time and latency time, Define seek time and latency time. ...

Define seek time and latency time.  The time taken by the head to move to the appropriate cylinder or track is known as seek time. Once the head is at right track, it must wai

Artificial life - artificial intelligence, Artificial Life - artificial int...

Artificial Life - artificial intelligence: Give birth to new exits forms.  A swot of Artificial Life will certainly direct on what it means for a complex system to be 'aliv

Evaluate fixed execution time, The statement of Gustafson's law can be desc...

The statement of Gustafson's law can be described with the help of an illustration. Let us take a problem, say P, which has to be solved using a parallel computer. Let Ts be the ti

RISC performance using optimizing compilers, Q. RISC Performance using opti...

Q. RISC Performance using optimizing compilers? Performance using optimizing compilers: As instructions are simple compilers can be developed for efficient code organization a

What is an assembler, An assembler is? Ans. An assembler is Machine dep...

An assembler is? Ans. An assembler is Machine dependant.

Work in standard view, Layout view is helpful for laying out Web pages. How...

Layout view is helpful for laying out Web pages. However you can adjust most of your design elements in Layout view, certain changes should be completed in Standard view. When you

Explain what are video and graphic in multimedia application, Question: ...

Question: (a) Copying a graphic image from the Web will be as easy as pointing to it and clicking the right mouse button or performing a screen capture. The question is, under

What is input - output instructions, Q. What is Input - Output Instructions...

Q. What is Input - Output Instructions? An I/O instruction is stored in memory of computer and is fetched as well as executed by processor producing an I/O-related command for

Explain the operation of JK flip flop when all inputs are 0, Write the trut...

Write the truth table for a clocked J-K flip-flop that is triggered by the positive-going edge of the clock signal. Explain the operation of this flip-flop for the following condit

Illustrate about first generation computers, Q. Illustrate about First Gene...

Q. Illustrate about First Generation Computers? It is certainly ironic that scientific inventions of great impact have frequently been linked with supporting a very sad as well

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd