Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
set -eu
function power-on-hours {
echo -n "$1: "
smartctl -A $1 | grep -i power_on_hours | perl -nlE '/\d+(\s\(.*\))?$/;say $&'
}
power-on-hours /dev/sda
power-on-hours /dev/sdb
power-on-hours /dev/sdc
power-on-hours /dev/sdd
power-on-hours /dev/sde
power-on-hours /dev/sdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment