How to send a message to certain users.

ENV: aix 3.2.0

DESC: You would like to be able to send a message to a certain user 
that will go to every tty or pts that they have open and sound a bell.

ACT: I wrote a short script which will do this.

for f in `ps -ef | grep \ | grep ksh | awk '{print $6}'`
echo $f | egrep "pts|hft"
if [[ $? -ne 0 ]]
echo \\^G > /dev/tty$f
echo \\^G > /dev/$f
 This script must be run as root. A setuid C program may be used to run
the script as a non root user. If you choose to use a setuid program, 
DO NOT change the script to allow command line arguments such as $1 for
username. This will open a security hole and allow unauthorized root access.
The username and message should be hard coded for security purposes. This
script will echo the message to the user and sound a bell. It may do this
more than once depending on the processes the user has running. I told 
you that this can be changed. If you wish to do so, you will have to
change this yourself.

Support Line: How to send a message to certain users. ITEM: AB2525L
Dated: August 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:31
Comments or suggestions? Contact us