LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-06-2003, 01:22 PM   #1
raven
Member
 
Registered: Dec 2001
Location: Basel, Switzerland
Distribution: ubuntu
Posts: 297

Rep: Reputation: 31
sending broadcast message in c


hello

i would like to send a broadcast message to every shell connected to my linux box trough a c program. Just the way when you do a "shutdown -h now" when every x-terminal and shell says to you, that the system will be halted.

How do I do this?

Thanks

raven
 
Old 12-06-2003, 02:55 PM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
Code:
system("shutdown -h now");
is far easier than any other approach.

You can also use wall just to send messages
Code:
char *mymessage={" 'Hello.' ");
char buf[256];
strcpy(buf,"wall ");
strcat(buf,mymessage);
system(buf);
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to broadcast a message to all user's. Tarts Slackware 28 02-13-2014 12:28 AM
gateway sending broadcast error jkmartha Linux - Networking 0 04-21-2005 08:47 AM
broadcast message to all santosh_rao99 Linux - Networking 2 07-29-2004 12:41 AM
broadcast message to all users JustinHoMi Linux - Software 1 11-14-2003 09:34 AM
How do I broadcast a message? miknight Linux - General 3 04-26-2003 02:24 AM


All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration