[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1249
  • Last Modified:

how do I use wall command in a shell script to send repeated message every 30 secs

I need to create a shell script which should send repeated broadcast message to all users every 30 seconds for 5 mins. It should then close the popup window on the users system.
0
aspnetdev
Asked:
aspnetdev
  • 3
  • 3
  • 2
1 Solution
 
omarfaridCommented:
What do you mean by "It should then close the popup window on the users system"?

Try

c=1
while test $c -lt 11
do
      wall "message......"
      sleep 30
      c=`expr $c + 1`
done
0
 
Pétur Ingi EgilssonSoftware Engineer -- ConsultantCommented:
omarfarid:

`wall "messag..."` does not work on my system as "wall" tries to read a file called "message..."
Instead i prefer `echo "Message" | wall`
0
 
omarfaridCommented:
You are right

My script modified to

c=1
while test $c -lt 11
do
      echo "message ...." | wall
      sleep 30
      c=`expr $c + 1`
done
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Pétur Ingi EgilssonSoftware Engineer -- ConsultantCommented:
note: Does not create popup windows in gnome cuz kwited is not in the GNOME configuration
http://www.experts-exchange.com/OS/Linux/Administration/Q_22470633.html

You could add "killall processName" to the end of that script if you know the name of the process which creates the "popups"
0
 
aspnetdevAuthor Commented:
I am using KDE,
0
 
Pétur Ingi EgilssonSoftware Engineer -- ConsultantCommented:
Did that command not work for you?
0
 
aspnetdevAuthor Commented:
it is giving syntax error
0
 
omarfaridCommented:
What is giving error?

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now