while true ; do
# sensors | grep low
if [[ "$@" =~ "-f1" ]] ; then
echo $(sensors | grep Core | cut -d '+' -f 2 | cut -d '(' -f 1) ", NVME:" $(sensors | grep low | cut -d '+' -f 2 | cut -d '(' -f 1)
elif [[ "$@" =~ "-f2" ]] ; then
echo $(sensors | grep low | cut -d '+' -f 2 | cut -d '(' -f 1) "," $(sensors | grep Core | cut -d '+' -f 2 | cut -d '.' -f 1) "," $(date +%Y-%m-%d_%H:%M:%S)
elif [[ "$@" =~ "-f3" ]] ; then
echo $(sensors | grep low | cut -d '+' -f 2 | cut -d '(' -f 1), $(sudo smartctl -a /dev/sda | grep Temperature_Celsius | cut -d ' ' -f 10), $(sensors | grep Core | cut -d '+' -f 2 | cut -d '.' -f 1), $(date +%Y-%m-%d_%H:%M:%S)
else
sensors | grep low
fi
[ ! $1 ] && break
sleep $1
done