C code linux

已关闭 已发布的 Feb 23, 2015 货到付款
已关闭 货到付款

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

项目ID: #7194086

关于项目

6个方案 远程项目 活跃的Apr 1, 2015

有6名威客正在参与此工作的竞标,均价$37/小时

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 更多

$80 CAD 在0天内
(1条评论)
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 更多

$20CAD 在1天里
(1条评论)
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 更多

$30CAD 在1天里
(0条评论)
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 更多

$25CAD 在1天里
(0条评论)
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.

$30CAD 在1天里
(0条评论)
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 更多

$35 CAD 在2天内
(0条评论)
0.0