Develop a C program for Linux called pipes

Assignment Help Taxation
Reference no: EM131166083

Develop a C program for Linux called pipes.c that does the following:

In the main() function, it creates a pipe using the pipe() function, then creates two child processes with fork(). Child 1 redirects stdout to the write end of the pipe and then executes with execlp() the "ls -al" command. Child 2 redirects its input from stdin to the read end of the pipe, then it executes the "sort -n -k 5" command.

After creating both children, the parent process waits for them to terminate before it can exit.

Note that you may have to create Child 2 first, followed by Child 1.

The parent program does the same thing as a shell that runs the command "ls -al | sort -r -n -k 5".

You must use the fork(), pipe(), dup2(), close(), execlp() functions (or other exec() variation). You can edit your program with the geditapplication, available from the command line. Or install emacs using command "sudo apt-get install emacs" and learn to use it.

Reference no: EM131166083

Questions Cloud

How many allowable moves are needed to move the disks : Describe the strategy you have used or would use in a recursive program to solve this problem.
Amount of initial investment : You invested in classic cars 7 years ago. You have earned an average compounded annual rate of 22 percent. The investment is now worth $350,000. What was the amount of your initial investment?
Amount of the current liabilities : The Corner Shoppe has a current ratio of 1.4, net fixed assets of $26,800, and total assets of $32,400. What is the amount of the current liabilities?
Determine the present value : Determine the future value (FV) of this annuity if your first $5,000 is invested at the end of the first year.- Determine the present value.
Develop a C program for Linux called pipes : In the main() function, it creates a pipe using the pipe() function, then creates two child processes with fork(). Child 1 redirects stdout to the write end of the pipe and then executes with execlp() the "ls -al" command. Child 2 redirects its input..
What is a recurrence for the running time of select1 : Let T(n) be the running time of the modified Select1 on n items. How can you express the running time of Magic Middle in terms of T(n)?
What is the equilibrium price and quantity of cigarettes : Suppose a public referendum is being held on whether or not to levy a tax on cigarettes. Currently, the supply of cigarettes is given by Qs = -900 + 200P. You estimate the demand for cigarettes to be Qd = 1200 - 50P. What is the equilibrium price ..
How do you find the second smallest element : How do you find the minimum (i = 1) or maximum (i = n) in a set? What is the running time? How do you find the second smallest element? Does this approach extend to finding the ith smallest? What is the running time?
What are the typical features of mammals : What are the typical features of mammals - What are the three major groups into which mammals are divided?

Reviews

Write a Review

 

Taxation Questions & Answers

  Partner shin received a distribution

Partner Shin received a distribution of $60,000 cash from the Shamrock Partnership in complete liquidation of his partnership interest.  If Shin's outside basis immediately before the distribution was $90,000, and if the partnership has a § 754 elect..

  Consolidated tax expense disclosed in financial statement

Identify and show the aspects of consolidated tax expense disclosed in the financial statements- Loss carrybacks and carryforwards.

  Compare realization of income with recognition of income

Compare and contrast realization of income with recognition of income. Tim is a plumber who joined a barter club. This year Tim exchanges plumbing services for a new roof.

  Questionalex is a tax resident of australia he is employed

questionalex is a tax resident of australia. he is employed as a mechanic at fix-a-car pty ltd with a salary of 60000

  Teledex company manufactures products to customers

Teledex Company manufactures products to customers' specifications and operates a job- order costing system. Manufacturing overhead cost is applied to jobs on the basis of direct labor cost. The following estimates were made at the beginning of th..

  Prepare the wardens joint individual tax return

You are to Prepare the Wardens' 2012 Form 1040 Joint Individual Tax Return, including Schedules A, B,, C, D, E, and F and Forms 2106, and any other form which you think is appropriate.

  What form would the gain or loss originally be reported

On what form would the gain or loss originally be reported? Form and what is the amount of gain or loss on the sale?

  Prepare a tax research memo for the tax files

Prepare a tax research memo for the tax files regarding the federal income tax treatment of the deductibility of the contribution to SDSU in the amount of $1,000 for the "right" to purchase tickets to basketball games for 2015.

  What is the total basis of the like-kind property received

How much is the realized gain, how much is the total boot, if any and is there mortgage boot? If so, how much

  Compute the project profitability index for each project

Compute the project profitability index for each project and rank the four projects in terms of net present value, project profitability index and internal rate of return.

  Minimize taxable income and maximize net income

Denton wants to minimize taxable income and maximize net income reported to stockholders.

  The more the fed accommodates shocks to money

The more the Fed accommodates shocks to money demand, the larger the (government) spending multiplier.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd