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
Q. How the Characters used in operand data type? A common form of data is character or text strings. Characters are signified in numeric form mostly in ASCII (American Standard

How to get an output: Please enter a number between 0 and 6 (Enter to stop): 2 The Day of Week is Tuesday Please enter a number between 0 and 6 (Enter to stop): 9 Input Invalid Ple

Take a CPU that shows two parallel fetch-implement pipelines for superscalar processing. Determine the performance improvement over scalar pipeline processing and no-pipeline proce

Write down the basic performance equation? T=N*S/R T=processor time N=no.of instructions S=no of steps R=clock rate

Q. Creating a New Directory in DOS? You can create any directory under any directory in the hard disk or floppy disk. The command to create a new directory is MKDIR or MD. To c

Why does FTP use two standard ports whereas other protocols, in general use only one port? Justify. File transfer protocol uses a control connection just to send commands and r

Q. What is Flash Memory? This memory is other form of semiconductor memory that was first introduced in mid-1980.  These memories can be reprogrammed at high speed and therefo

Divide overflow is generated when  (A) Sign of the dividend is dissimilar from that of divisor.  (B) Sign of the dividend is same as that of divisor.  (C) The first part


The number of control lines for 32 to 1 multiplexer is ? Ans. For 32 (2 5 ) the number of control lines and to select one i/p between them total 5 select lines are needed.