dotfiles/script/sysinfo

12 lines
229 B
Bash
Executable File

#!/usr/bin/env bash
#
# Print loadavg to stdout
set -e
if [ "$(uname -s)" = "Darwin" ]; then
uptime | tr -d ',' | grep -o "[0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+"
else # Linux
cut -d " " -f 1-3 /proc/loadavg
fi