Operating System - HP-UX
1837835 Members
2393 Online
110121 Solutions
New Discussion

message to all users logged in

 
SOLVED
Go to solution
Oliver Schmitz
Regular Advisor

message to all users logged in

Dear all,

how to send a short message to all users which are logged in to a workstation before maintenance shutdown?

Thanks and best regards,

oliver
Oliver Schmitz
12 REPLIES 12
Bharat Katkar
Honored Contributor
Solution

Re: message to all users logged in

Oliver,

# wall
Type your message here
Press D to finish

#

Regards,
You need to know a lot to actually know how little you know
Indira Aramandla
Honored Contributor

Re: message to all users logged in

Hi,

If you need to issue a general message to all the users logged on the server then issue the command wall

wall
â message textâ followed by CTRL/D
Never give up, Keep Trying
Robert-Jan Goossens
Honored Contributor

Re: message to all users logged in

Hi Oliver,

Create a message with vi and save it,

# wall < message

Regards,
Robert-Jan
Rainer von Bongartz
Honored Contributor

Re: message to all users logged in

use the wall command or shutdown with a grace period and 'send your own message' option

Regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Sanjay Kumar Suri
Honored Contributor

Re: message to all users logged in

You can use following command
wall file_name

where file_name contains the short message.

sks

A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Ravi_8
Honored Contributor

Re: message to all users logged in

Hi

#wall

ctrl+d

never give up
H.Merijn Brand (procura
Honored Contributor

Re: message to all users logged in

All of the above gave the correct answer for the default state of users logged in

B U T . . .

All users (and applications) can disable the reception of the messages sent with 'wall' with

# mesg n

mesg without argument gives you the current state, also in it's return value

Hope this helps (a bit).
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Isralyn Manalac_1
Regular Advisor

Re: message to all users logged in

You can use the wall command for this. See the man pages.

Regards,

Ira
bergmans
New Member

Re: message to all users logged in

what about users logging in after your wall command?
Bharat Katkar
Honored Contributor

Re: message to all users logged in

Shutdown will take care of them. :))
You need to know a lot to actually know how little you know
Cheryl Griffin
Honored Contributor

Re: message to all users logged in

You might want to use wall and update the /etc/motd.

wall reaches those already logged in.
/etc/motd will reach those logging in after the fact.

"Downtime is a Crime."
Theo Langenberg
Occasional Advisor

Re: message to all users logged in

Oliver,

You can do it on a funny way,

# who
user1 ttyp1 Jul 29 08:36
user2 ttyp2 Aug 10 07:55
user3 ttyp5 Aug 10 12:11

cat message_file > /dev/ttyp1
..
cat message_file > /dev/ttyp1

OR

for i in `who | awk '{print $2}'
do
cat message_file > /dev/${i}
done

rgrds Theo