C code linux

Closed Posted Feb 23, 2015 Paid on delivery
Closed Paid on delivery

Your task is to write a simple Unix command-line shell (like bash). Obviously your shell will not be as featureful as bash is. Your shell will be written in C.

Your shell should consist of a loop which:

Reads in a line of text from the user (e.g., via fgets). You may assume a maximum line length of 100 characters

Parses that line of text into an array of words .

Using the fork(), execvp() and waitpid() system calls, launches the requested program and waits until the program has finished

In addition to running external programs, your shell must also support 2 builtin commands (commands which are handled by NOT fork()ing and execvp()ing). Those two builtin commands are:

exit. If the user types in "exit" as a command, your shell should exit (i.e., end the loop)

cd. If the user types in "cd" followed by another word, your shell should execute the chdir() system call directly. The chdir() system call has not been discussed in class, but you should find sufficient documentation on chdir() by typing in "man chdir" at a Linux command-line or by typing "man chdir" into Google

To determine whether the user has typed in a bulitin command or typed in a command that should be completed by an external program (via fork() and execvp()), use the strcmp function in standard C. The strcmp function will return to you a value of 0 if two strings have the same value, which can be used to determine if the user typed in "exit" or "cd".

Linux

Project ID: #7194086

About the project

6 proposals Remote project Active Apr 1, 2015

6 freelancers are bidding on average $37 for this job

efiguerc

Hi there, It happens that I already did a shell like the one you are asking for (look what people comment about my work). I just added the 2 build in commands ('exi't and 'cd') functionality. So if you let me work for More

$80 CAD in 0 days
(1 Review)
1.8
thms00

Hi there. I do C for fun, and it's the first langage I learned, reading the Kernighan&Ritchie. I know the stdlib almost by heart. Moreover, I have been using Linux for more than 7 years so I have some skills tha More

$20 CAD in 1 day
(1 Review)
0.6
RishabhRawat

I have completed a similar project once and it will be just a matter of porting it for you. I have a lot of experience with C and will provide you a complete documented C code and will entertain any queries you migh More

$30 CAD in 1 day
(0 Reviews)
0.0
nagpalsahil01

Have programmed such programs a lot in my labs. Can code well in c and completed my Google Summer of Code project with KDE using C++. Have experience in Operating systems and totally comfortable with Linux. Will try to More

$25 CAD in 1 day
(0 Reviews)
0.0
dmytrolopatiuk

Hello! I have read description of your task. I've been programming in C language for 4 years, so I can easily solve your project within a day.

$30 CAD in 1 day
(0 Reviews)
0.0
embisoft

Hello, I am excellent c programmer and using ubuntu(linux) for my programming. Concerning your requirement, this is a bit easy for me because i have done some projects like this that consist File I/O, Socket Progra More

$35 CAD in 2 days
(0 Reviews)
0.0