dotfiles/script/sysinfo

12 lines
217 B
Bash
Executable File

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