#!/bin/bash for (( i = 0; i < 4; i++ )) do echo $i if [ -f /sys/class/hwmon/hwmon$i/name ]; then content=$(cat /sys/class/hwmon/hwmon$i/name) if [ $content=="atk0110" ]; then atk0110=$i fi if [ $content=="radeon" ]; then radeon=$i fi fi done echo $atk0110 echo $radeon