Write a minishell using the template code

Assignment Help Computer Engineering
Reference no: EM132206550

Write a minishell using the template code below
* Implement function type_prompt( )

* Making read_command( ) work could be a little more involved.

* Note that the command contains the first argument, the file name, while parameters contain all information of input line in any arrays of strings, including the executable file name, same as in the command, as its first string. For example the command ssh -1 joe pluto.hood.edu is stored as

parameter[0]: /usr /bin/ ssh

parameter[1]: -1

parameter[2]: joe

parameter[3]: pluto.hood.edu

parameter[4]: NULL

Donot forget to initialize a dynamic string, before filling it with characters.

Some of the most commonly used commands are built in command handled by shell,for example, exit. You will not be able to test these commands unless you implement within your shell program. Built in commands is processed by the shell program without invoking the fork-exec() loop.

#define TRUE 1
while (TRUE) { /* repeat forever */

type prompt( ); /* display prompt on the screen */

read command(command, parameters); /* read input from terminal */

if (for k() != 0) { / * fork off child process */

/* Parent code. */

waitpid(-1, &status, 0); /* wait for child to exit */

}else {

/* Child code. */

execve(command, parameters, 0); /* execute command */ }

}

Reference no: EM132206550

Questions Cloud

Write a method that return the index of the smallest element : Write a method that returns the index of the smallest element in an array of integers. There are no duplicate elements in the array.
Why will the economy converge to particular level of capital : Solve for both a general algebraic expressions (all variables) AND specific equations (K is the only variable) for the level of savings and the level.
Write a method named pay that accepts two parameters : Write a method named pay that accepts two parameters: a real number for a TA's salary, and an integer for the number of hours the TA worked this week.
Determine what is the nash equilibrium : Netflix, Hulu and Amazon Prime are three streaming services that all offer a range of movies and TV shows. Together these three products dominate.
Write a minishell using the template code : uilt in commands is processed by the shell program without invoking the fork-exec() loop.
Calculate the row sum for every row and returns each : Write a method public static int[] allRowSums(int[][] a) that calculates the row sum for every row and returns each of the values in an array.
Define the recurrence relation : You may assume that length of x is at least the length of y and neither of x or y has the character $.
What are determinants of foreign exchange rate : List and explain the determinants of foreign exchange rate based on the purchasing power parity and the interest rate parity. What are determinants of foreign.
How many square feet of solar panels should be installed : "A building owner is considering installing solar roof panels on a building. The cost of installing solar panels is $19,000 + $15.80*S.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is an image description language

What is an image description language? What are the advantages of representing images with image description languages?

  Explain the costs involved in the creation of the system

Describe the types of business needs that can be addressed using information technology-based solutions.

  Write program that inputs data for a weighted network graph

Write a computer program, using the language of your choice, that inputs the data for a weighted network graph and computes the least-cost paths using Dijkstra'

  Name the network software that provides this mapping

Network protocols require an IP address in order to be able to communicate with another computer.

  Federal rules and criminal codes

Think about computer forensics professional’s testimony preparations, and how the investigator must ensure that the federal rules and criminal codes are followed both during and after the completion of the investigation. Identify and discuss some ..

  How do i grab ip addresses from sites of the sort

I was told that the command "netstat" can be used to grab ip addresses from websites like twitter, facebook, twitch and others.

  What is the effect of the given statement

What is the effect of the statement m[1234] = "Jane Smith";? What is returned by m[1234]? What is returned by m[1500]?

  Make sure you correct the error before closing the program

If you haven't received an index error in one of your programs yet, try to make one happen. Make sure you correct the error before closing the program.

  Write a program that prompt the user to enter the x-position

Write a program that prompts the user to enter the x- and y-positions of a center point and a radius, using text fields.When the user clicks a Draw button.

  What is the multiplexers

Show how two 2-to-1 multiplexers can be connected to form a 3-to-1 multiplexer without any additional gates.

  Make a table in microsoft word

build a table in Microsoft Word or Excel that lists the strengths and challenges of each of the following four system development life cycles presented in the text.

  Defining the variable r at the beginning of the function

Instead of declaring and defining the variable r at the beginning of the function, declare it inside the loop that uses it.

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