From 6172d5441f69dce76dbb87de02ea759207ee4d78 Mon Sep 17 00:00:00 2001 From: nsfoxer <1261805497@qq.com> Date: Wed, 8 Apr 2020 13:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A6=96=E9=A1=B5=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=9C=A8=E7=BA=BF=E5=88=97=E8=A1=A8=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=B8=80=E4=BA=9B=E8=B0=83=E8=AF=95=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/get_users_num.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 scripts/get_users_num.sh diff --git a/scripts/get_users_num.sh b/scripts/get_users_num.sh new file mode 100755 index 0000000..6eb0d5a --- /dev/null +++ b/scripts/get_users_num.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# 2020年 04月 08日 星期三 12:04:33 CST +# 输入:无 +# 输出: ../temp/current_users.log +location=$(dirname $0) +users=$(ls ${location}/../temp/ | grep '.txt' | grep -v log.txt| cut -d '_' -f 1 | uniq) +echo "$users"; + +if [[ $(echo "$users" | wc -w) == 0 ]] +then + users="无人在线"; +fi +echo "$users"; + +echo ${users} > ${location}/../temp/current_users.log +