#!/bin/bashdeclare -i count=0while true;doif who |grep -q -E "^root"thenecho -e "用户root 登陆了系统\n 这是第$count 次"breakelselet count++fisleep 3done