Question: Shell: Write a program called mchecker to check for new mail and write a message to the screen if new mail has arrived. a. The

Shell:

Write a program called mchecker to check for new mail and write a message to the screen if new mail has arrived.

a. The program will get the size of the mail spool file for the user. (The spool files are found in /var/spool/mail/$USER on Linux, Use the find command if you cannot locate the file.) The script will execute in a continuous loop, once every 30 seconds. Each time the loop executes, it will compare the size of the mail spool file with its size from the previous loop. If the new size is greater than the old size, a message will be printed on your screen, saying Username, You have new mail.

The size of a file can be found by looking at the output from ls l, wc c or from the find command.

Note: To test this, you can simply edit the spool file to add a new entry.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!