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

What are instruction hazards, What are instruction hazards? The pipelin...

What are instruction hazards? The pipeline might also be stalled because of a delay in the availability of an instruction. For instance, this may be a result of a miss in the c

What is dynamic modelling, What is Dynamic Modelling  As you know that...

What is Dynamic Modelling  As you know that computer systems are built from the objects which respond to events. External events arrive at boundary of system; you understan

C Programming, Program about railway reservation system using structure . G...

Program about railway reservation system using structure . Get 10 names,their gender ,address , seats availability according to trains and some extra datas

For what is defparam used, For what is defparam used? Though,  during  ...

For what is defparam used? Though,  during  compilation  of  Verilog  modules,  parameter  values  can  be  altered  separately  for every module instance. This allows us to pa

Message passing model, In the message-passing model, there exists a set of ...

In the message-passing model, there exists a set of tasks that use their own local memories during computation. Multiple tasks can reside on the similar physical machine as well ac

What is hamiltonian path, What is Hamiltonian path?  A Hamiltonian path...

What is Hamiltonian path?  A Hamiltonian path in a directed graph G is a directed path that goes through every node exactly once. We consider a special case of this problem whe

Illustrate processor arrangements, Q. Illustrate processor arrangements? ...

Q. Illustrate processor arrangements? HPF$ PROCESSORS P2 (4, 3) !HPF$ TEMPLATE T2 (17, 20) !HPF$ DISTRIBUTE T2 (BLOCK, *) ONTO P1 Means that first dimension of T2 woul

Explain about binning?, Binning process is very helpful to save space. Perf...

Binning process is very helpful to save space. Performance may differ depending upon the query generated sometimes solution to a query can come within some seconds and sometimes it

Difference between shadow and override in programming, Overriding tell us o...

Overriding tell us only the methods, but shadowing tells us the entire element.

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