Help!! shell script

Help!! shell script

Post by Johnn » Thu, 04 May 2000 04:00:00



Hi everyone:

Can everyone help me do the following prgram written in shell script?
A program is required which will monitor the host on which it runs for any
login/logout activity; reporting any change of status to the user display
accompanied by a beep. [Such a program is an example of an agent.]

Notes:

The time interval at which sampling occurs is to be supplied as a command
line argument.

Only one instance of the program can be run by a user on any host at the one
time. Instances may run simultaneously on different hosts.

The user is to specify in advance on which hosts the program is permitted to
run. This information is not to be located in the program code itself.

The program must exit in an orderly fashion when the user logs out, i.e. it
must be able to start up and function sensibly the next time that user logs
in.

You are to provide as part of the Specification section of your
documentation an explanation of how the program is to be started up
automatically each time the user logs in.

Output should be as concise as possible but should at least show who has
logged in/out since last this information was sampled.

The program must be able to be terminated by the user without needing to
lookup the process table and kill the relevant process.

Your main logic should be implemented as a Shell script, but you may call
other programmable utilities, e.g. awk, or write modules in C if you think
that is necessary. However you must ensure that your solution logic is
independent of such implementation choices.

The command sleep may be of some use.

Particular attention should be paid as to how this program is to be tested,
and a careful description is to be given in the Test Plan section.

Refer to earlier warnings in regard to any attempts to include mischievous
code in executables.

Thank you so much!!!

 
 
 

Help!! shell script

Post by Noal McDonal » Thu, 04 May 2000 04:00:00



Quote:> Can everyone help me do the following prgram written in shell
> script? A program is required which will monitor the host on
> which it runs for any login/logout activity;

Any changes in logged in users will be reflected in a change of the date
stamp of /etc/utmp.  The file /etc/wtmp is a login history file.  To use
either, enter "who /etc/wtmp" or "who /etc/utmp" as appropriate.

HTH,
Noal McDonald
--
"What you cannot enforce, do not command."
-- Socrates

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Help!! shell script

Post by Michael Sternber » Thu, 04 May 2000 04:00:00



> A program is required which will monitor the host on which it runs for any
> login/logout activity; reporting any change of status to the user display
> accompanied by a beep. [Such a program is an example of an agent.]

Please do the homework yourself.

You may find the man pages of users(1), who(1) and rwho(1) helpful.
For good book suggestions, check the current thread: "Shell Book Please" in this
newsgroup.

Regards,
--
Michael Sternberg                        | Uni-GH Paderborn
http://www.phys.uni-paderborn.de/~stern/ | FB6 Theoretische Physik
phone: +49-(0)5251-60-2329   fax: -3435  | 33098 Paderborn, Germany
"Who disturrrbs me at this time?"  << Zaphod Beeblebrox IV >>     <*>

 
 
 

Help!! shell script

Post by Ted J. Loeffelhol » Thu, 04 May 2000 04:00:00



> Hi everyone:

> Can everyone help me do the following prgram written in shell script?
> A program is required which will monitor the host on which it runs for any
> login/logout activity; reporting any change of status to the user display
> accompanied by a beep. [Such a program is an example of an agent.]

> Notes:

> The time interval at which sampling occurs is to be supplied as a command
> line argument.

> Only one instance of the program can be run by a user on any host at the one
> time. Instances may run simultaneously on different hosts.

<snip>
</snip>

Quote:

> Refer to earlier warnings in regard to any attempts to include mischievous
> code in executables.

> Thank you so much!!!

You will get a much better response if you post what you already have or
what you have tried.  It is not our responsibility to do your homework
for you.

Specific questions work much better ... at least it shows that you
tried.

--
Cheers,
Ted J. Loeffelholz
Senior Design Engineer
Caterpillar Inc

 
 
 

Help!! shell script

Post by John F » Fri, 05 May 2000 04:00:00


Do your own stuff Johnny Boy!!!
WE ARE NOT HERE TO DO YOUR ASSIGNMENT FOR YOU!!

Ask specific questions only... not the assignment question!!


Quote:> Hi everyone:

> Can everyone help me do the following prgram written in shell script?
> A program is required which will monitor the host on which it runs for any
> login/logout activity; reporting any change of status to the user display
> accompanied by a beep. [Such a program is an example of an agent.]

> Notes:

> The time interval at which sampling occurs is to be supplied as a command
> line argument.

> Only one instance of the program can be run by a user on any host at the
one
> time. Instances may run simultaneously on different hosts.

> The user is to specify in advance on which hosts the program is permitted
to
> run. This information is not to be located in the program code itself.

> The program must exit in an orderly fashion when the user logs out, i.e.
it
> must be able to start up and function sensibly the next time that user
logs
> in.

> You are to provide as part of the Specification section of your
> documentation an explanation of how the program is to be started up
> automatically each time the user logs in.

> Output should be as concise as possible but should at least show who has
> logged in/out since last this information was sampled.

> The program must be able to be terminated by the user without needing to
> lookup the process table and kill the relevant process.

> Your main logic should be implemented as a Shell script, but you may call
> other programmable utilities, e.g. awk, or write modules in C if you think
> that is necessary. However you must ensure that your solution logic is
> independent of such implementation choices.

> The command sleep may be of some use.

> Particular attention should be paid as to how this program is to be
tested,
> and a careful description is to be given in the Test Plan section.

> Refer to earlier warnings in regard to any attempts to include mischievous
> code in executables.

> Thank you so much!!!

 
 
 

1. Please Help! Shell Script

Hi, everybody:

I encounted the following problem

I've written a simple program of pattern matching.

For instance, if the pattern is 'good', and there is a line
'good morning' from a text file.

If I type the command
 match 'good' input
Result: good morning

The line containing the text 'good monring ' will be print out on the
standard output.

What if I want lines tht match several patterns? If these patterns have
to OR-ed together (ie. we want all lines that match any of the
patterns),
it is still possible to write a trial shell-script to do the task
However,we may wish to provide the user with a more direct interface for
doing
this.
The obvious way is to have a "file option" tht works as follows:
match -f patternfile input > output

we can keep things simple by requring the "-f" flag be separed from
the filename by a whitespace on the command -line. We also want to
continue
providing users with the defaults way of specifying a single pattern on
the command-line (without any flag - the interface change is
"backwrd_compatible'.

Could any one tell me how to finish the above task?

Thank you in advance!

Peter

2. booting msdos from 2nd disk

3. Help! shell script

4. HELP: TAR/FTP/SYSTEM hangs when file == BIG!

5. Help ! Shell scripting

6. ADSM Tivoli5.1 Client for Solairs 2.6

7. HELP!! shell script for file removal...

8. Wanted: source code for 'resize' command

9. HELP!! shell script for recursive file removal..

10. HELP!! shell script for, file removal....

11. Shell Script Help (C-Shell Script)

12. handling SIGINT in shell scripts when executing another shell script.

13. Q: How can I have a shell script call another shell script...