c programming project (Command Language Interpreter)
This project was successfully completed by pivn for $100 AUD in 2 days.Get free quotes for a project like this
Project Budget$30 - $250 AUD
Completed In2 days
See attached file, a brief snippet of the task is below:
A Command Language Interpreter (CLI) accepts input from the user, and exe-
cutes the commands issued. The logic of the CLI is given below:
get input line
if end of input exit
break line into words
found := false
if command is builtin
do_builtin ( line )
found := true
found := find_and_execute ( line )
if not found report error
Your rst task will be to write a program that repeatedly reads a line of input
from the user, the fgets() function will help you here. Your program should
end when either end of le is encountered, or the word exit appears in the
input as the rst word of a line.
Your next task will be to break the line up into words, which are separated
by one or more spaces. strtok() may help you with this task.
You should then create a new process using fork(), and then use one of
the exec() family of functions to run the program requested. The CLI process
must pause until the created process is concluded, wait() will need to be used
here. Once the new process has nished you must print out the exit status of
One this works you should add a builtin function cd to change the working
directory of the CLI. The chdir() function will be vital here.
Looking to make some money?
- Set your budget and the timeframe
- Outline your proposal
- Get paid for your work
Hire Freelancers who also bid on this project
Looking for work?
Work on projects like this and make money from home!Sign Up Now
- The New York Times
- Wall Street Journal
- Times Online