Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

linux a Q4. Create a script named dmesg_warnings.sh that will count the number of warning messages in the dmesg log file and display them. [53

linux
image text in transcribed
a Q4. Create a script named dmesg_warnings.sh that will count the number of warning messages in the dmesg log file and display them. [53 marks) It is necessary to follow the instructions listed below when writing your script, The output from your script should match the format of the sample output below. The date should be printed as the first line of output and it should be displayed in the exact format shown in the sample output below. The warning messages should be retrieved from the dmesg log file (do a case insensitive search for the word "Warning" in the dmesg log file in location: /var/log/dmesg). Any warning messages found should be stored in a temporary file. The total number of warning messages should be printed out. All of the warning messages should then be displayed to the user. There should be a blank line separating each line of output, as seen in the sample output below. Notes : The date and number of warnings should be stored as variables within the script. Test your script on one of the servers (student or student2) and when you are satisfied that it is working, paste your script in the Answer box below. Any temporary files created should be removed after use. The output of the script should match the sample output below. if the script is run as follows >/dmesg_warnings.sh Sample output: 28/12/21 13:29:03 Total number of WARNINGS : 1 WARNINGS found in dmesg log file: | 1.472723) 18042: Warning: Keylock active te) Focus English (New Zealand)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

Students also viewed these Databases questions

Question

=+j Understand different types of regions in the world.

Answered: 1 week ago