Quote:
Originally Posted by cfajohnson
You can use shell parameter expansion to extract what you want. E.g.:
Code:
temp=$( sensors | grep 'CPU Temp:' )
temp=${temp##*/}
|
Thank you. I ended up doing the following (It is not the complete script, but the part I asked about works well.)
Code:
cur_tmp=$(sensors | grep 'CPU Temp:' | awk '{ print $3 }')
cur_tmp=${cur_tmp#+}
cur_tmp=${cur_tmp%°C}