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
Reason behind using Intranet The major reasons for doing this include: -  Safer as there is less chance of external viruses or hacking -  It's possible to prevent employe

Web pages or materials which are in the form of hypermedia documents accessed through Internet can be located anywhere in world. No matter from where they originated, most Web d

There are three primary colours in pigments - Red, Yellow and Blue. There are two ways to produce more colours:   Physical Mixing: Physically mix colours to produce a new colour

what is inheritence and all types in java?

Software Aspects: Software is a generic term covering the concepts, procedures and instructions which enable computer systems to do useful things. Usually, software is conceiv

Computer to computer transmission of structured data using standardised documentation is known as Electronic data interchange (EDI).

in asp project is i have to crate database every time when i move my project on different server

Illustrate the application of E-Commerce in Home Banking. Home Entertainment: E-commerce has show the way to HOME ENTERTAINMENT. The video aspect generally includes a la

Define the Unified Modelling Language  (UML) is used to express construct and relationships of complex systems. This was created in response to a request for proposal (RFP) fro

A scope resolution operator (::), can be used to describe the member functions of a class outside the class.