urgent 1-Order now from essaywritingagents.com

urgent 1-Order now from essaywritingagents.com
Assignment 3 – Improving a Shell
In this assignment you shall take an existing implementation of a shell program and add some small improvements to it.
Preparation – Downloading, Compiling and Testing a simple Shell Implementation
Download and un-compress the following file:
The contents of the file are C sources that implement a simple shell. The contents are:

smsh.c – an implementation of a very simple shell program
smsh.h – a header file with function prototypes
execute.c – a set of helper functions for running processes within the program
splitline.c – some text processing utilities

To compile these sources run:
gcc -o smsh1 smsh1.c splitline.c execute.c
To run the shell type:
A prompt of the form “>” will appear and then you can type commands like:
> ls
execute.c  shell.tgz  smsh.h  smsh1  smsh1.c  splitline.c
> wc execute.c
      37    113      725  execute.c
The shell is terminated by typing the Control-D key (which signals end of input).
In this assignment you shall add functionality to this shell command. Each part builds upon the last. 
Part 1 – Adding the ability to pipe commands to your shell (30 marks)
At the moment smsh1 doesn’t support piping of commands. So, for example, if you type:
ls | wc
at the prompt you get:
ls: wc: No such file or directory ls: |: No such file or directory
Write a new program called smsh2.c that is based on smsh1.c which performs all of the shell operations of smsh1.c but also allows commands to be piped as above so that if you type:
ls | wc
You get output like: 
6       6      53
instead. You are free to add and modify files as required to accomplish this task. You must add a Makefile to your submission so that you can compile all the files for part1 by typing:
make part1
and the solution for part 1 can be run by typing:
Note, your program must still cater for all the behaviours that were correct in the original version of smsh1. You may find the lectures on piping useful in completing this part. 
Part 2 – redirecton of stdin and stdout (30 Marks)
Your version of smsh2 currently doesn’t support redirection of output and input of commands such as:
ls > tmp.txt cat < tmp.txt | wc > out.txt
Copy your smsh2.c program from part 1 to smsh3.c so that it can handle redirection of standard input and standard output (don’t worry about stderr) using the “>” and “
Looking for a similar paper from proficient writers?
Place an order with us to get the best grades in your class!
Our papers are original
We will email you a copy together with the plagiarism report!