Recognize the command exit to mean that your shell program

Assignment Help Computer Engineering
Reference no: EM132213821

Write a shell in C/C++

**Prefer this to be written in C++**

You do NOT need to be concerned with piping the output of commands to other commands or background job control

Your shell should use the fork system call and the execv system call (or one of its variants) to execute commands. The shell needs to use either wait or waitpid system calls to wait for a program to complete execution.

You should recognize the command exit to mean that your shell program should terminate by calling the exit() system call.

A very simple shell such as this needs at least the following components:

a command-line parser to figure out what the user is trying to do.

If a valid command has been entered, the shell should use fork to create a new child process, and the child process should exec the command.

Your shell will need to support file redirection. Use the same syntax as defined in the Bash shell: a single '>' implies that one needs to redirect the standard output of the program being started to the referenced file while a single '<' implies the same with standard input.

The double '>>' implies that standard output will append to an existing file rather than create a new file (similar behavior is required for the '<<' operator and standard input). You do not need to implement support for the Bash pipeline operator '|'.

Before calling exec to begin execution, the child process may have to close stdin (file desriptor 0) and/or stdout (file descriptor 0), open the corresponding file and use the dup2 system call to make it the appropriate file descriptor. Don't forget to use the close system call to close the old file descriptor.

Reference no: EM132213821

Questions Cloud

Have you worked with powerpoint before : What challenges are you running into as you persuasive speech ? How is it going overall? Have you worked with PowerPoint before?
Memory systems design and potential performance : Comment briefly on how having multiple cores on a processor affects the memory systems design and potential performance.
Fill the vector d with the numbers 1 to 10 in descending : Write a simple MATLAB script to complete the following task: Write a sequence of steps to: Fill the vector C with numbers 1 to 10 in ascending order.
Tradeoff between the number of cache lines : Briefly explain the tradeoff between the number of cache lines and the size of each cache line.
Recognize the command exit to mean that your shell program : Your shell should use the fork system call and the execv system call (or one of its variants) to execute commands.
What exactly is big data : How would you describe "Big Data" and "IoT" (Internet of Things) to your parents if they were to ask you about it over the holidays?
What is the digital divide : What is the digital divide and what social differences in our society does this phenomenon highlight?
Defin the process of making the decision : ECON545 Fully explain the organization's purpose and the process of making the decision. Basically, what made them make this choice?
Provide a picture or a sketch that illustrates the interface : Provide a picture or a sketch that illustrates the interface. Briefly explain what makes it good or bad, using criteria from the text.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create a community and strengthen their brand

How well does this website acquire fans, generate engagement, amplify responses, create a community, and strengthen their brand?

  Take a byte-addressable computer with 24-bit addresses

take a byte-addressable computer with 24-bit addresses, a cache capable of storing a total of 64KB of data, and blocks of 32 bytes. Show the format of a 24-bit memory address for.

  What is the final step in determining observability

What is the final step in determining observability if the observability matrix is a square matrix?

  Demonstrate that it works with table and another table

This method will return the number of elements in the array that are odd numbers. Note that the arrays might be rectangular or ragged.

  Briefly explain the complement system

Repeat problem for B, a negative number, represented in the twos complement system.

  What feature allows the vm running in the window to appear

What feature allows the vm running in the window to appear as if it is the only operating system running on your computer?

  Write a program in php and javascript

In PHP and Javascript, when the given function has verified that all of the necessary field have been filled, a cookie is added to the user's computer.

  Valuate user dialog strategies used by menu-driven interface

Evaluate the user dialog strategies used by a menu-driven interface. Determine why menu-driven interfaces continue to be popular in the modern computing age.

  Write verilog testbench for universal shift register module

Write a Verilog testbench for Universal Shift Register module. The testbench will instantiate the USR, redefining its parameter to N = 4, generate a clock signal, and apply a stimulus sequence to the USR inputs.

  Why does a static library have the lib prefix

Why does a static library have the lib prefix? What suffix does it have? Where are the system's library and include files available?

  Write down a dbn that represents the dynamics of the model

We track K moving objects u1, . . . , uK, using readings obtained over a trajectory of length T. Write down a DBN that represents the dynamics of this model.

  Define the divide-and-average algorithm

The divide-and-average algorithm for approximating the square root of any positive number a is as follows: Take any initial approximation x that is positive, and then find out a new approximation by calculating the average of x and a/x, that is, (..

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