Implement a Small UNIX Shell

Implement a Small UNIX Shell

Overview and Goal

The goal of this task is to write a simple but functional UNIX shell in C. It


Print a shell prompt ($)

Read multiple commands from standard input and execute them

Support shell variables and expansion

Support the variable $? to print out the return code of the last program

Run programs in the background if desired

Support redirection of standard input, output and error

Support the pipeline operator (|)

See expected output below for details.

Important Notes

Executing any real shell (e.g. /bin/bash) through exec(), popen() or

any other means is not a valid solution. All of the functionality must be

implemented by yourself in shell.c!

Do not use isatty() to check if your shell is running in a terminal (e.g.

to display a prompt only in this case). The CI environment is not using a


It is recommended to use fflush() to flush the output streams (otherwise,

e.g. CI tests may not work properly)

Expected Output

Print a shell prompt ($) when ready



Read multiple commands from standard input and execute them

$ echo Hello


$ expr 1 + 3


Support shell variables and expansion

$ A=5

$ echo $A


$ echo ${A}BC


$ A=$A$A

echo $A


Support checking the return code of the last program using $?

$ true

$ echo $?


$ false

$ echo $?


Support running programs in the background with &

$ firefox &


After this, Firefox should be running and the shell accepting commands again.

Support redirection of stdin, stdout and stderr with >, < and 2>

$ echo Hello > [login to view URL]

$ cat - < [login to view URL]


Support the pipeline operator |

$ echo Hello | tr l L | tr o ?



Total points possible: 7

Minimum number of points required to pass: 5

Points can be obtained as follows:

1 Point: Correct display of shell prompt

1 Point: Read and execute multiple commands

1 Point: Support shell variables and expansion

1 Point: Support $? for displaying the return code of the last program

1 Point: Support & for running programs in the background

1 Point: Support redirection of stdin, stdout and stderr

1 Point: Support pipes with |

the project / source has to compile with the attached makefile

Aptitudini: Programare C, Programare C++, Linux, Arhitectură software, UNIX

Vezi mai multe: unix shell scripting institute hyderabad, excel unix shell scripts, list different project implement small organization, linux tcpip apache unix shell sql, unix shell script monitor active java process, unix shell scripting projects bid, check system health using unix shell script, freelance unix shell scripting programming, sequence diagrams unix shell scripts, danske unix shell providers, unix shell script alert log file, unix shell scripting freelancer, introduction unix shell scripting dbas, Unix shell script, unix shell scripting, unix shell script edit csv files, project unix shell history features, unix shell menu oracle install script, small unix shell script

Despre angajator:
( 0 recenzii ) Germany

ID Proiect: #28984363

Acordat lui:


Hi, I have a professional experience of over 3 years working in C/C++ and have worked on projects related to system programming during my university tenure. I hope to provide you the required solution within desired ti Mai multe

%selectedBids___i_sum_sub_7%%project_currencyDetails_sign_sub_8% EUR în 10 zile
(5 Recenzii)

5 freelanceri licitează în medie 177€ pentru acest proiect


Hi , I can write the shell for you as requested in short time in Objective C or C++ . Let's talk in details if you are interested

%bids___i_sum_sub_35%%project_currencyDetails_sign_sub_36% EUR în 7 zile
(9 recenzii)

Let me support you. ------------------------------------------- More than 18 years of experience in Tutoring, Freelancer. Excellent in C, C++, JAVA, PHP, .NET, PHP Web, Desktop, Console applications. Data Structure (Li Mai multe

%bids___i_sum_sub_35%%project_currencyDetails_sign_sub_36% EUR în 2 zile
(5 recenzii)

Hello I am a , professional programmer for standalone projects.I’m very experienced with c platforms for over 10 years, so I’m sure I can help you to convert your system and ready to start now. Don’t hesitate tot cont Mai multe

%bids___i_sum_sub_35%%project_currencyDetails_sign_sub_36% EUR în 3 zile
(1 părere)

please discuss. Negotiable price and duration...........................................................................................................................................................

%bids___i_sum_sub_35%%project_currencyDetails_sign_sub_36% EUR în 4 zile
(1 părere)