More
    
        | author | Steve Losh <steve@stevelosh.com> | 
    
        | date | Mon, 19 Aug 2024 08:55:42 -0400 | 
    
        | parents | eb9f31c299b8 | 
    
        | children | 46c8ae0df6cc | 
#!/usr/bin/env bash
set -euo pipefail
function find_names {
    grep . /sys/class/hwmon/hwmon*/name
}
function find_coretemp {
    grep 
}
if test -z "${1:-}"; then
    find_names
else
    dir=$(find_names | grep "$1" | cut -d / -f 5)
    paste \
        <(grep . "/sys/class/hwmon/$dir/"temp*_label | sort) \
        <(grep . "/sys/class/hwmon/$dir/"temp*_input | sort) \
        | tr -s ':' ' ' \
        | awk '/Core/ {print $2, $3, $5/1000.0 }' \
        | sort -n -k2
fi