Chinaunix首页 | 论坛 | 博客
  • 博客访问: 682123
  • 博文数量: 111
  • 博客积分: 2109
  • 博客等级: 上尉
  • 技术积分: 1124
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-25 12:11
个人简介

通信码农,Emacs爱好者,业余IOS程序员,更业余的PM

文章分类

全部博文(111)

文章存档

2018年(2)

2016年(2)

2015年(2)

2014年(13)

2013年(21)

2012年(71)

分类: 其他平台

2013-04-08 10:47:34

Sometimes as the administrator of a Linux Operating System Server, you may need to send a message to all users. There are some different ways to do this, and now we will see just one of them.

We will use wall.

As the main input of wall is a file, we will first create our message file.

For example: you want to tell users that in two more hours the main SQL database is going to be unavailable because of maintenance.

So type:

echo 'Please note that in two more hours, and for one hour, you will not be able to use the SQL database, please save all your job before, and quit any application using it.' > message.txt

OK, now we have our message ready, it is time to send it to the users.

wall < message.txt

And something like this will appear on all terminals open.

Broadcast Message from                                              
        (/dev/pts/3) at 9:56 ...                                               
                                                                               
Please note that in two more hours, and for one hour, you will not be able to u
se the SQL database, please save all your job before, and quit any application 
using it.

More, you can use pipe to implement it, which is the left job to you.


 转自 http://lichengwulove.blog.163.com/blog/static/846483112010101415916297/

阅读(1666) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~