Question

In: Computer Science

As you complete each of the following steps, keep track of what occurs at each point;...

As you complete each of the following steps, keep track of what occurs at each point; including what you type, the output given, and any errors experienced. Submit this information in a log to your instructor for this week’s assignment. Your log can use the sample format provided, or you can create your own.

1. Run the following script:

a. #!/bin/bash

b. count=1

c. echo "start of the program"

d. while [ $count -le 10 ]

e. do

1) echo "Loop #$count"

2) sleep 10

3) count=$[ count + 1 ]

f. done

g. echo "end of the program

2. Modify the program to add a trap for SIGINT and SIGTERM.

3. Save the script and then run the script in the background.

4. Use the jobs command to display a list of the jobs currently running.

5. Find the process id of the script and kill the job.

6. Check to see if you get the trap message.

7. Run the script again using the at command to schedule the job in the future. Wait for the job to run to make sure it executes.

PLEASE POST SCREENSHOTS.

Solutions

Expert Solution

#!/bin/bash

warning(){
echo -e "\n*** CTRL+C and CTRL+Z keys are disabled. Please enter number only. Hit [Enter] key to continue..."
}
trap warning SIGINT SIGTERM
count=1
echo "start of the program"
while [ $count -le 10 ]
do
   echo "Loop #$count"
   sleep 10
   count=$[ count + 1 ]
done
echo "end of the program"

warning

if you have any doubt then please ask me without any hesitation in the comment section below, if you like my answer then please thumbs up for the answer, before giving thumbs down please discuss the question it may possible that we may understand the question in a different way and I can edit and change the answers if you argue, thanks :)


Related Solutions

Establishing a method for collecting rent each month will make it easier to keep track of...
Establishing a method for collecting rent each month will make it easier to keep track of the rent collection process. Choose the number of houses and rent per house by your choice. Develop a python program to maintain the rent collection process. Update the database with the details of every month like the name of the tenant, house number, month of the rent, rent amount, EB bill amount, maintenance charge, etc., Print the details of rent collection for all houses...
Consider the following set of requirements for a UNIVERSITY database that is used to keep track...
Consider the following set of requirements for a UNIVERSITY database that is used to keep track of students' transcripts. (a) The university keeps track of each student's name, student number, social security number, current address and phone, permanent address and phone, birthdate, sex, class (freshman, sophomore, ..., graduate), major department, minor department (if any), and degree program (B.A., B.S., ..., Ph.D.). Some user applications need to refer to the city, state, and zip of the student's permanent address, and to...
rationale for each steps taken to complete the task
rationale for each steps taken to complete the task
You are tasked to design an application to keep track of sales for your company. Sales...
You are tasked to design an application to keep track of sales for your company. Sales should be tracked for two types of accounts: supplies and services. Complete the following:     Create a UML class diagram for the Account inheritance hierarchy. Your subclasses should be Supplies and Services.     All sales accounts will have an account ID (accountId).     You will need attributes to keep track of the number of hours (numberOfHours) and rate per hour of services provided (ratePerHour)....
You will design a program to keep track of a restaurants waitlist using a queue implemented...
You will design a program to keep track of a restaurants waitlist using a queue implemented with a linked list. Make sure to read pages 1215-1217 and 1227-1251 1. Create a class named waitList that can store a name and number of guests. Use constructors to automatically initialize the member variables. 2. Add the following operations to your program: a. Return the first person in the queue b. Return the last person in the queue c. Add a person to...
You will be building a linked list. Make sure to keep track of both the head...
You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. PlaylistNode.h - Class declaration PlaylistNode.cpp - Class definition main.cpp - main() function Build the PlaylistNode class per the following specifications. Note: Some functions can initially be function stubs (empty functions), to be completed in later steps. Default constructor (1 pt) Parameterized constructor (1 pt) Public member functions InsertAfter() - Mutator (1 pt) SetNext() - Mutator...
Problem statement: You are tasked with writing a simple program that will keep track of items...
Problem statement: You are tasked with writing a simple program that will keep track of items sold by a retail store. We need to keep track of the stock (or number of specific products available for sale). Requirements: The program will now be broken up into methods and store all the inventory in an ArrayList object. The program will be able to run a report for all inventory details as well as a report for items that are low in...
You are going to create a console based program to keep track of a small business...
You are going to create a console based program to keep track of a small business that sells Doodads. First you will need to create a class Doodad that keeps track of two integers and two Strings. Next, create a constructor for the Doodad. Next, add getters and setters for each of the fields (two integers and two Strings). You need to use Doodad.java (see the starter code) Inside your main method ask the user to read in the two...
For ONE day, keep track of all of the electrical devices that you make use of...
For ONE day, keep track of all of the electrical devices that you make use of and for how long. (eg. Microwave oven for 3 minutes; hair dryer for 5 minutes; TV for 90 minutes;...) Track only those devices over which you have direct control and don’t bother about things like home heating and refrigerators that are too challenging to track. Using either a published table of common power ratings (cite your source), or information read off of the device...
Problem statement: You are tasked with writing a simple program that will keep track of items...
Problem statement: You are tasked with writing a simple program that will keep track of items sold by a retail store. We need to keep track of the stock (or number of specific products available for sale). Requirements: The Food and Book items should inherit all the properties of the Product item in the previous assignment. Foods cannot be added to the inventory without an expiration date. Implement a toString method for Product, Food, and Book. Grading details: Correct usage...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT