Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a shell script to send a customized mail message to the users listed on the command line by login (user) name, only if they

Write a shell script to send a customized mail message to the users listed on the command line by login (user) name, only if they are currently logged on.

If no users are listed on the command line an error message should be printed.

In the mail message, you should use the full (real) name from the passwd file (/etc/passwd).

You also need to sign the script with the real name of the person who is running the script.

This can be derived from the $USER environment variable and looking up the value in the password file.

An error message should be printed if the user does not exist in the passwd file or in NIS (YP)

The password information on the server is stored in NIS (Yellow-Pages YP).

You can use ypmatch or ypcat passwd to get the information

On the server, the information is both in /etc/passwd or can be extracted in the manner listed above.

The real name of the user of the script should only be computed once.

A "Here-Document (In-Line Redirection)" must be used for the mail message. No temporary files shall be used. The message should be as follows: Hello , **** This email is automatically generatated by ****** My boss requires that I send this message as part of a project. The current time and date is . Have a nice day

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

Step: 3

blur-text-image

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

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions

Question

=+a. the invention of the iPod

Answered: 1 week ago