我对 grep 和 sed 命令相当陌生。如何在 bash 脚本中使用 grep 或 sed+50.0
提取?Core 0: +50.0°C (high = +80.0°C, crit = +90.0°C)
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)
重击脚本:
#!/bin/bash
temp=`sed -n '/^Core 0: $/,/^(high/p' ~/Desktop/sensors.txt`
echo $temp