shell/shell脚本编程进阶/查看uptime获取在线用户数.sh

4 lines
62 B
Bash

#!/bin/bash
#
uptime | sed 's/user.*$//' | gawk '{print $NF}'