Question: Write a shell script that produces a file of sequential numbers by reading the last number in the file, adding 1 to it, and then
Write a shell script that produces a file of sequential numbers by reading the last number in the file, adding 1 to it, and then appending it to the file. Run one instance of the script in the background and one in the foreground, each accessing the same file. How long does it take before a race condition manifests itself? What is the critical region? Modify the script to prevent the race.
Step by Step Solution
3.37 Rating (166 Votes )
There are 3 Steps involved in it
A possible shell script might be if f numbers then echo 0 numbers fi count 0 while test count 20... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
761-C-S-D-B-O-S (324).docx
120 KBs Word File
