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

  Taxable income

Determine taxable income before considering expense.

  Prepare a tax research memo

Prepare a tax research memo to the file that addresses the issues you feel are most relevant to Mimi's various issures.

  Income by ordinary concepts

Explain what is meant by income by ordinary concepts

  Identify the tax issues

Identify the tax issues that are raised and the relevant sections of the legislation. Identify any cases and other sources of law or information that apply.

  Calculate carolines taxable income

Calculate Carolines taxable income

  Taxation – law and practice

Show the tax issues that are raised and the relevant sections of the legislation.

  Payment to the taxpayer

Brief statement in your own words of the facts of the cases.

  Prepare regular corporation tax return

Prepare the C Regular Corporation Tax Return for the Lawson And Norman Enterprise

  Taxation law

Advise the participants in the ‘barter' system of the income tax implications, if any, of participating in the system.

  A tax on cigarettes is a good way of raising tax revenue

Discuss- A tax on cigarettes is a good way of raising tax revenue for the government

  Prepare the required journal entry

Prepare the required journal entry to record the tax expense

  Calculate barbs taxable income

Calculate Barb's taxable income? What nonrefundable credit is Barb eligible for based on the information you have?

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