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

  1 as you read make notes in the margin with a pencil about

1. as you read make notes in the margin with a pencil about which forms to use anything you remember about the

  Prepare her income tax return in 2009

You will also need to consider the liabilities that arise because of the specific laws that cover tax agents. This would include liability to Pamela and any possible problems with your tax agents licence.

  Individual income tax return forms for joseph and diana

Ignore the requirement to attach the Form(s) W-2 to the front page of the Form 1040. If required information is missing, use reasonable assumptions to fill in the gaps.

  What if congress passed legislation that increased tax rates

What if Congress passed legislation that increased tax rates next year? Should Tesha ask the company to change its policy this year?

  Prepare a comprehensive analysis of the authority

Prepare a comprehensive analysis of the authority (court decisions,Internal Revenue Code, Treasury Regulations and IRS pronouncements, i.e., Revenue Rulings) that pertain to the issues.

  Question 1 prior to 2012 pretax financial income and

question 1. prior to 2012 pretax financial income and taxable income were identical.2. pretax financial income is

  Prepare the tax entries for 1996 in accordance with sfas

Assume that in 1996 accounting income is $2,000. There is one new temporary difference: installment sale income of $350 is recognized in 1996 but will not be taxed until 1997 when the cash is collected.

  If the cost of capital for a project of an all equity firm

If the cost of capital for a project of an all-equity firm is 14 percent, should Loma replace Model P with Model T?

  Income tax project

Complete all necessary information on the "Federal Information Worksheet". To enter specific tax related information, you must enter the form, schedule or document that relate to the tax related information you wish to enter.

  Discuss the hong kong tax implication of the profits

Evaluate Ms Chan's situation by referring to the six badges of trade and advise on whether the gain will be subject to Hong Kong profits tax. As the information given above may not be sufficient to deal with the issue adequately.

  Updike and patterson investments inc upi hold equity

updike and patterson investments inc. upi hold equity investments with a cost basis of 250000. upi accounts for these

  Jorges marginal tax bracket

Jorges marginal tax bracket is 25 percent. Advise Jorge of the tax ramification if he stays in Saudi Arabia only six months and if he stays there an additional six months.

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