Write a shell that is similar to Fig. 1-10 but contains enough code that it actually works
Question:
Write a shell that is similar to Fig. 1-10 but contains enough code that it actually works so you can test it. You might also add some features such as redirection of input and output, pipes, and background jobs.
Transcribed Image Text:
while (TRUE) { type_prompt(); } read command (command, parameters); if (fork() != 0) { /* Parent code. */ } waitpid (-1, &status, 0); } else { /* Child code. */ execve(command, parameters, 0); /* repeat forever */ /* display prompt on the screen */ /* read input from terminal */ /* fork off child process */ /* wait for child to exit */ /* execute command */ Figure 1-10. A stripped-down shell. Throughout this book, TRUE is assumed to be defined as 1.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 25% (4 reviews)
include include include include include define TRUE 1 ...View the full answer
Answered By
Vincent Omondi
I am an extremely self-motivated person who firmly believes in his abilities. With high sensitivity to task and operating parameters, deadlines and keen on instructions, I deliver the best quality work for my clients. I handle tasks ranging from assignments to projects.
4.90+
109+ Reviews
314+ Question Solved
Related Book For
Operating Systems Design And Implementation
ISBN: 9780131429383
3rd Edition
Authors: Andrew Tanenbaum, Albert Woodhull
Question Posted:
Students also viewed these Computer science questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Googles ease of use and superior search results have propelled the search engine to its num- ber one status, ousting the early dominance of competitors such as WebCrawler and Infos- eek. Even later...
-
1.Discuss 5 (five) direct benefits and 5 (five) indirect benefits that GovTech would have if the Enterprise Architecture is successfully implemented in GoxTech (500 words) 2.Discuss 5 (five) key...
-
Pick a Nigerian brand that has been very successful competing against the bigger global brands in its product category. What are the elements of its strategy that have enabled it to achieve this...
-
The board of directors of Pictures Plus authorizes the issue of $6,000,000 of 8%, 15-year bonds payable. The semiannual interest dates are May 31 and November 30. The bonds are issued on May 31,...
-
Consider the system shown in Fig. P1-81. If a change of 0.7 kPa in the pressure of air causes the brine-mercury interface in the right column to drop by 5 mm in the brine level in the right column...
-
Table B. 24 contains data on home rental prices and home sales. Use all possible regressions to build a model for these data. Perform a residual analysis on the final model and comment on model...
-
Frobisher Inc. (Frobisher) uses the lower of cost and NRV rule to value its inventory. Frobishers inventory on February 28, 2017 had a cost of $1,125,000 and a NRV of $1,035,000. Required: a. By how...
-
An financial institution has 2 kinds of assets: 50% in T-bill and 50% in consumer loan. If the assets in the portfolio need to be liquidated at short notice, the T-bill is sold at $97 even though its...
-
Write a program (or series of programs) to test all the MINIX 3 system calls. For each call, try various sets of parameters, including some incorrect ones, to see if they are detected.
-
The initial versions of the Pentium could not support a virtual machine monitor. What essential characteristic is needed to allow a machine to be virtualizable?
-
Determine if S is a function. S = {(-3,7), (-1,7), (3,9), (6, 7), (10,0)}
-
Vector Manufacturing (VM) makes replacement parts for the automotive industry. One particular part can be manufactured at a unit cost of \($0.75\) for material and \($0.25\) for direct labor....
-
On August 1, 1958, first-class postage for a 1-ounce envelope was 4. On August 1, 2007, a first-class stamp for the same envelope cost 41. What was the annual compound increase in the cost of...
-
A Payne County commissioner has \($20\),000 remaining in the budget to spend on one of three worthy projects. Each is a one-time investment, and there would be no follow-on investment, regardless of...
-
Anewengineering department head is joining the university and during a visit hasmade an offer on a homefor \($350\),000 with a 20 percent down payment. The offer has been accepted pending success in...
-
Based on Baders expectations for current account secular trends as shown in Exhibit 1, Bader should reallocate capital, all else being equal, from: A. Country A to Country C. B. Country B to Country...
-
List some of the major differences in accounting between IFRS and U.S. GAAP.
-
On July 1, 2011, Flashlight Corporation sold equipment it had recently purchased to an unaffiliated company for $480,000. The equipment had a book value on Flashlights books of $390,000 and a...
-
Implement the containKey(k) method, as described in Exercise R-10.3, for the SortedTableClass.
-
Consider lines 3133 of Code Fragment 10.8 in our implementation of the class ChainHashMap. We use the difference in the size of a secondary bucket before and after a call to bucket.remove(k) to...
-
Modify the Pair class from Code Fragment 2.17 on page 92 so that it provides a natural definition for both the equals( ) and hashCode( ) methods.
-
For parts (a) through (c) below, represent each sum with a number-line diagram. 3 = 16 1 3 (a) 6 A. + Choose the correct model below and fill in the answer box within your choice. 6 B. = 316 16 . 316...
-
3. A swimming pool is shaped like the light blue area in the figure below (not to scale), with a 4 foot wide brick pathway around it. Write complete solutions to the following, rounding your answers...
-
Company A pays $42,500 yearly with a guaranteed raise of $1,300 per year. Company B pays $44,500 yearly with a guaranteed raise of $600 per year. Which company will pay more for the first 10 years of...
Study smarter with the SolutionInn App