极简Linux实时聊天
实时查看聊天内容:
信息内容保存在 mes.log 文件中
tail -f mes.log
查看多条:
tail -100f mes.log // 数值可以自行修改
code:say
#!/bin/sh
name=***
nowTime=`date '+%Y-%m-%d %H:%M:%S'`
mes=$1
echo "$nowTime" >> mes.log
echo "$name: $mes" >> mes.log
使用:
# 可以修改文件 say 的权限:
chmod +x say
# 发送信息:
./say "your message"
或
sh say "your message"
两个窗口使用,效果更佳哟 (≧▽≦)/