Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Program to be used in Unix in the language C: Part I: Specific Details The watch program you write must meet the following

Write a Program to be used in Unix in the language C:image text in transcribed

Part I: Specific Details The watch program you write must meet the following specifications: alre lognames as cmand ine aguments. It waches for he comings and going of the lognames specified on the command line. It does not report on users you do not specify. b] When the program starts, it prints the lognames of users on the given list who are currently logged in. [c] It checks the utmp file every 300 seconds to see if anyone on the list of lognames has logged in or logged out. If the first command line argument is an integer, it uses that number as the number of seconds to sleep between checking the utmp file d] The program reports when a user on the list logs in. A user is considered to have logged in if, when the utmp file was last checked, that user was not logged in anywhere, but now the user is logged in at one or more terminals page 1 watch e] The program reports when a user on the list logs out. A user is considered to have logged out if, when the utmp file was last checked, that user was logged in, but now the user is not logged in at any terminals. The program should produce output of the form (the.. indicates five-minute pauses) % watch betsy happy maya fido king susie betsy happy are currently logged in happy logged out susie logged in happy king logged in Part I: Specific Details The watch program you write must meet the following specifications: alre lognames as cmand ine aguments. It waches for he comings and going of the lognames specified on the command line. It does not report on users you do not specify. b] When the program starts, it prints the lognames of users on the given list who are currently logged in. [c] It checks the utmp file every 300 seconds to see if anyone on the list of lognames has logged in or logged out. If the first command line argument is an integer, it uses that number as the number of seconds to sleep between checking the utmp file d] The program reports when a user on the list logs in. A user is considered to have logged in if, when the utmp file was last checked, that user was not logged in anywhere, but now the user is logged in at one or more terminals page 1 watch e] The program reports when a user on the list logs out. A user is considered to have logged out if, when the utmp file was last checked, that user was logged in, but now the user is not logged in at any terminals. The program should produce output of the form (the.. indicates five-minute pauses) % watch betsy happy maya fido king susie betsy happy are currently logged in happy logged out susie logged in happy king logged in

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

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

Differentiate. y = 2 + cot

Answered: 1 week ago

Question

Draw a labelled diagram of the Dicot stem.

Answered: 1 week ago

Question

Persuasive Speaking Organizing Patterns in Persuasive Speaking?

Answered: 1 week ago