Write a small c program called tinyshell that behaves much

Assignment Help Computer Engineering
Reference no: EM132213972

Write a small C program called tinyshell that behaves much like a shell; but your program has to accept and respond to the following four commands only, presented one at a time:

world n - run the command called world and pass the argument n to it

mars n - run the command called mars and pass the argument n to it

newcat file - run the newcat program to display the file on standard output

quit - terminate execution of the tinyshell

The tinyshell program works as follows: puts out a prompt next command> and then reads the command string typed by the user (use scanf).

If the command typed by the user is not one of the above four, it responds with an error message and prompts the user again. If the command typed is quit the program is terminated.

Otherwise, it reads, as a string, the remaining part of the command (i.e., the count n or the file name). Then it executes the command world or mars or newcat as required.

For this, tinyshell forks and the parent process immediately executes wait. The child process executes execlp to overlay itself with the code of world or mars or newcat. On its completion, the parent process resumes execution putting out a new prompt for the next command.

Reference no: EM132213972

Questions Cloud

Report the total payments by date when the total payments : Report the total payments by date when the total payments are greater than $20,000. Which orders have a value greater than $5,000?
Write a single if-statement that is true on the range of i : Write a single if-statement that is true on the range of i values shown and false on all other values.
Write a single sql statement to list all the tracks : Write a single SQL statement to list all the tracks that have the exact word 'time' as part of the name in the Track table.
Write a source code in java nxt legos for this lawn mower : Motor A is the blade which is constantly spinning. Motor B and C are the whelels. The robot has 2 sensors. Touch sensor and light sensor.
Write a small c program called tinyshell that behaves much : The tinyshell program works as follows: puts out a prompt next command> and then reads the command string typed by the user (use scanf).
A code that adds two 32 bit numbers stored : Write a small code in assembly language that adds two 32 bit numbers stored at K1 and M1, and then stores the result in K1+6.
Write statements that assign random integers to the variable : Write statements that assign random integers to the variable n in the following range: -5 =n = 5
Fill the array with random numbers between 1 and 25 : Use a constant to set the size of your array, you should be able to change size in one line and still have a robust program.
Describe trading and available for sale securities : Beginning in 2018 the accounting for investments in stock changed. The former methods used were accounting for stock as trading securities.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What ordering of the brands do you think is best

Draw a barchart of the number of respondents per brand. What ordering of the brands do you think is best?

  How do you think this is reflected in their art

In the New Kingdom Egypt acquired an empire and became wealthier than ever. How do you think this is reflected in their art?

  Write down the bit pattern that would represent

Using the IEEE 754 floating-point format, write down the bit pattern that would represent -1/4. Can you represent -1/4 exactly?

  Significant investigative approachesfor cyber crime cases

Research information related to how the computer forensics investigators in today’s world of the computer forensics investigations prepare for the execution of an actual investigation.

  Explain principles of digital analysis

Explain Principles of digital analysis discussion. When creating forensic images, verifying an image's integrity (i.e., whether or not it is an exact bit-for-bit copy of the original evidence) is very important.

  What is the address and data buses

Draw a timing diagram relative to the CPU clock shown in Figure, which includes the address and data buses. R/W_L and the write control.

  Create a web page that will display timetable

Your job is to complete a number of practical tasks to implement a client-side front-end that will implement the desired functionality. A number of resources are available to help you complete these tasks - you must complete the design commentary ..

  Solves a system of linear equations

Write a function that solves a system of linear equations or calculates the inverse of a matrix by Gauss-Jordan elimination.

  Write statements to define an input and an output stream

Write statements to define an input stream and an output stream and associate them to the following files, respectively: in.dat, out.dat.

  What are the two basic forms of compression

What are the two basic forms of compression? Run-length encoding can be used to compress what kind(s) of data?

  A program that prints the ids and scores of all 10 students

Write a function struct student* allocate() that allocates a contiguous chunk of memory for 10 students and returns the pointer.

  Discuss the use of cloud backup strategies

Describe and discuss at least two backup strategies. Discuss the use of cloud backup strategies, as well?

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