dotfiles/script/sysinfo

12 lines
217 B
Plaintext
Raw Normal View History

2021-04-06 18:25:06 +00:00
#!/usr/bin/env bash
#
# Print loadavg to stdout
set -e
2023-10-07 08:43:32 +00:00
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