Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Government College University Developing Multi-Process Program Worksheet

Government College University Developing Multi-Process Program Worksheet

Government College University Developing Multi-Process Program Worksheet

Description

Unix shell with redirects and pipes

The purpose of this assignment is to learn to develop multi-process programs. You are expected to extend the myshell.c program and add pipelines and I/O redirections. In particular, your shell program should recognize the following:

> – Redirect standard output from a command to a file. Note: if the file already exists, it will be erased and overwritten without warning. For example,COP4338$ ls > 1 COP4338$ sort myshell.c > 2
Note that you’re not supposed to implement the Unix commands (ls, sort, …). You do need to implement the shell that invoke these commands and you need to “wire” up the standard input and output so that they “chain” up as expected.

>> – Append standard output from a command to a file if the file exists; if the file does not exist, create one. For example,COP4338$ sort myshell.c >> 1 COP4338$ echo “Add A Line” >> 1

  1. < – Redirect the standard input to be from a file, rather than the keyboard. For example,COP4338$ sort < myshell.c COP4338$ sort < myshell.c > 1 COP4338$ sort > 1 < myshell.c
    The second and third commands are the same: the sort program reads the file named myshell.c as standard input, sorts it, and then writes to file named 1.

| – Pass the standard output of one command to another for further processing. For example,COP4338$ ls | sort COP4338$ sort < myshell.c | grep main | cat > output

Make sure you have your parent process fork the children and ‘wire’ them up using pipes accordingly. There will be spaces separating tokens in the command line. Your program should be able to run with all the Unix commands as expected. Don’t assume your program will only be tested by the above commands. Also, there could be more than two commands chained by pipes, like the second example above.

  1. Your program needs to provide necessary sanity-check from the user input. Prompt meaningful errors accordingly as what you’d experience with your shell.

Hint: use strtok() functions to separate the tokens and use strstr() to locate sub-strings.

  1. You should place the source code and the Makefile in the directory. One should be able to create the executable called myshell by simply ‘make’. The Makefile should also contain a ‘clean’ target for cleaning up the directory (removing all temporary files, object files and executable files). Make sure you don’t include intermediate files: *.o, executables, *~, etc., in your submission. (There’ll be a penalty for including unnecessary intermediate files).

Please make sure you submit homework before the deadline. Extensions cannot be given for the final program.

If the program does not compile and do something useful when it runs it will not earn any credit.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20