bar-uptime.sh 217 B

123456
  1. #! /bin/bash
  2. set -euo pipefail # bash strict mode
  3. upt="$(uptime --pretty | sed -e 's/up //g' -e 's/ days/d/g' -e 's/ day/d/g' -e 's/ hours/h/g' -e 's/ hour/h/g' -e 's/ minutes/m/g' -e 's/, / /g')"
  4. echo -e Up: "$upt"