Florida State College at Jacksonville Programming Questions

Description

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 > 2Note 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< - 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.cThe 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 > outputMake 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.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.

User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.

Reviews, comments, and love from our customers and community:

Article Writing

Keep doing what you do, I am really impressed by the work done.

Alexender

Researcher

PowerPoint Presentation

I am speechless…WoW! Thank you so much!

Stacy V.

Part-time student

Dissertation & Thesis

This was a very well-written paper. Great work fast.

M.H.H. Tony

Student

Annotated Bibliography

I love working with this company. You always go above and beyond and exceed my expectations every time.

Francisca N.

Student

Book Report / Review

I received my order wayyyyyyy sooner than I expected. Couldn’t ask for more.

Mary J.

Student

Essay (Any Type)

On time, perfect paper

Prof. Kate (Ph.D)

Student

Case Study

Awesome! Great papers, and early!

Kaylin Green

Student

Proofreading & Editing

Thank you Dr. Rebecca for editing my essays! She completed my task literally in 3 hours. For sure will work with her again, she is great and follows all instructions

Rebecca L.

Researcher

Critical Thinking / Review

Extremely thorough summary, understanding and examples found for social science readings, with edits made as needed and on time. Transparent

Arnold W.

Customer

Coursework

Perfect!

Joshua W.

Student

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>