dotfiles/script/sysinfo

12 lines
215 B
Plaintext
Raw Normal View History

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