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
Specify the goals of parsing. Goals: a. To check the validity of source string b. To agree on the syntactic structure of a source string. For invalid string this rep


Let us see the pairs that can be considered as adjacent in Karnaugh's here. The pairs are:  1)  The four corners  2)  The four 1's as in top and bottom in column 00 & 01

What is the need of interrupt controller?  The interrupt controller is employed to expand the interrupt inputs. It can handle the interrupt requests from several devices and pe

Explain difference between macro call and macro expansion. Macro expansion: While a macro name is used along with a set of actual parameters this is replaced through a code g

Fail-first - artificial intelligence: Alternatively one such dynamic ordering procedure is known like "fail-first forward checking". In fact the idea is to take advantage of i

Just run the PHP CLI (Command Line Interface) program and give the PHP script file name as the command line argument. For instance, "php myScript.php", assuming "PHP" is the comman

Why is the Wait-For-Memory-Function-Completed step required when reading from or writing to the main memory? WMFC step is needed for the write control signal / read control si

A Master group consists of? A master group have 300 voice channels.

What do you mean by best fit?  Best fit allocates the smallest hole that is big enough. The whole list has to be searched, unless it is sorted by size. This method makes the sm