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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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