#!/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