Accept commands from the user, Computer Engineering

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.

Posted Date: 4/3/2013 2:54:53 AM | Location : United States







Related Discussions:- Accept commands from the user, Assignment Help, Ask Question on Accept commands from the user, Get Answer, Expert's Help, Accept commands from the user Discussions

Write discussion on Accept commands from the user
Your posts are moderated
Related Questions
What is Parallel Sections Construct? The parallel sections construct is a shortcut for specifying a parallel construct comprising one sections construct however no other statem

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

Which is valid syntax of the Fork and Join Primitive? Ans. A valid syntax of the Fork and Join Primitive is as given below: Fork Join

Q. Binary number system using 8 bit registers? Add 25 and -30 in binary number system using 8 bit registers using: Signed magnitude representation Signed 1's comple

What are the features of ABAP/4 Dictionary? The most significant features are: Integrated to aABAP/4 Development Workbench. Active in the runtime environment.

Complementary metal oxide semiconductor (CMOS) refers to a chip inside your computer that saves your BIOS settings. As a result, the terms CMOS & BIOS are sometimes used interchang

? Object: The interaction among objects takes place in a system. An object is depicted by a rectangle with the name of the object, preceded by a colon and underline. ? Relation

Define Rules for Reducing Karnaugh Maps? The rules for reducing Karnaugh Maps (k- maps) are as follows: All of the 1's in the Karnaugh Map are called as minterms. The

Make a base class called figure that store the dimensions of several geometrical objects and compute their areas. Explain a function set_dim( ),a standard member  function and show

A neural network can be definite as a model of reasoning based on the human brain. The human brain incorporates nearly 10 billion neurons and 60 trillion connections, Synapses amon