C Programming

Completado Publicado Mar 22, 2015 Pagado a la entrega
Completado Pagado a la entrega

Your first task will be to write a program that repeatedly reads a line of input from the

user, the fgets() function (see Sect. 5 for usage information of all system provided

functions) will help you here. Your program should end when either end of the input

file is encountered, or the exact word exit appears in the input as the only word on a

line.

Your next task will be to break the line up into words, which are separated by one or

more spaces. The provided function tokenize() does this, and it uses strtok()

internally. You may use this function if you wish, in which case you should provide

documentation on its operation, or you may write your own parser.

You should next implement the find_and_execute() section of the logic

above, by creating a new process using fork(), and then use one of the exec()

family of functions to run the program requested by the user in the text provided. If

1

he requested program cannot be run then an appropriate error message should be displayed,

perror() will help with this (as there are many reasons why this may fail),

and the child process terminated.

The CLI process must pause until the created process is concluded, wait() will

need to be used here. Once the new process has finished you must decode and print out

the exit status of that process.

Once this works you should add a builtin function cd to change the working directory

of the CLI. This builtin should always use the next word supplied as the directory

to change to, failure to supply a destination should be treated as an error. The chdir()

function will be vital here

Programación en C

Nº del proyecto: #7349743

Sobre el proyecto

4 propuestas Proyecto remoto Activo Mar 22, 2015

Adjudicado a:

vano101

A proposal has not yet been provided

$35 USD en 2 días
(504 comentarios)
6.6

4 freelancers están ofertando un promedio de $116 por este trabajo

cscinstructor

I have read and fully understood your requirements. Please open chat to discuss further….. =================+++++++++++++++++++++++++======================

$233 USD en 7 días
(2 comentarios)
2.2
ithuang2014

hello. I saw your description and attached files. I understand it and can do it . I have done several project like this. I'm an expert in Data Mining, Data Structures and Algorithms. And I know Java and C/C++ well Más

$100 USD en 3 días
(7 comentarios)
1.8
tzzcl

一个有效的提议尚未被提供

$30 USD en 1 día
(1 comentario)
1.4
manursareena

I am C programmer with 7 years of industrial experience in kernel programming. I am currently a researcher in high performance algorithms for medical image analysis using C/C++.

$166 USD en 4 días
(0 comentarios)
0.0