I am fairly new to grep and sed commands.How can +50.0
be extracted from Core 0: +50.0°C (high = +80.0°C, crit = +90.0°C)
using grep or sed in bash script?
acpitz-virtual-0
Adapter: Virtual device
temp1: +50.0°C (crit = +89.0°C)
temp2: +50.0°C (crit = +89.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +50.0°C (high = +80.0°C, crit = +90.0°C)
Core 2: +47.0°C (high = +80.0°C, crit = +90.0°C)
Bash Script:
#!/bin/bash
temp=`sed -n '/^Core 0: $/,/^(high/p' ~/Desktop/sensors.txt`
echo $temp