linux-tutorial/codes/shell/示例脚本/进阶脚本/查看uptime获取在线用户数.sh

4 lines
62 B
Bash

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