2016-12-11 7 views
-5

このスクリプトがあります。サーバーの一時データを出力します。あなたはbashスクリプトで、通常はそれをしませ実行すると、それはサーバーの一時データを出力し、このコマンドを出力するbashスクリプトの出力をクリーンアップするには

#!/bin/bash 

echo $(sensors -f) 

sleep 20 

done 

ようになります。あなたはbashスクリプトで、通常はそれをしませ実行すると、この


i5k_amb-isa-0000 
Adapter: ISA adapter 
Ch. 0 DIMM 0: +145.4°F (low = +221.0°F, high = +255.2°F) 

Ch. 0 DIMM 1: +141.8°F (low = +221.0°F, high = +248.0°F) 

Ch. 1 DIMM 0: +141.8°F (low = +221.0°F, high = +255.2°F) 

Ch. 1 DIMM 1: +133.7°F (low = +221.0°F, high = +255.2°F) 

Ch. 2 DIMM 0: +158.9°F (low = +221.0°F, high = +255.2°F) 

Ch. 2 DIMM 1: +134.6°F (low = +221.0°F, high = +255.2°F) 

Ch. 3 DIMM 0: +131.9°F (low = +221.0°F, high = +248.0°F) 

Ch. 3 DIMM 1: +148.1°F (low = +221.0°F, high = +255.2°F) 

coretemp-isa-0000 
Adapter: ISA adapter 
Core 0:  +123.8°F (high = +179.6°F, crit = +212.0°F) 

Core 1:  +114.8°F (high = +179.6°F, crit = +212.0°F) 

Core 2:  +120.2°F (high = +179.6°F, crit = +212.0°F) 

Core 3:  +118.4°F (high = +179.6°F, crit = +212.0°F) 

coretemp-isa-0001 
Adapter: ISA adapter 
Core 0:  +127.4°F (high = +179.6°F, crit = +212.0°F) 

Core 1:  +118.4°F (high = +179.6°F, crit = +212.0°F) 

Core 2:  +118.4°F (high = +179.6°F, crit = +212.0°F) 

Core 3:  +118.4°F (high = +179.6°F, crit = +212.0°F) 

ようになりますので、これは正常に見えます。スクリプトを使って実行する場合を除いて、これを取得します。


i5k_amb-isa-0000 Adapter: ISA adapter Ch. 0 DIMM 0: temp1_input: 63.000 temp1_max: 124.000 temp1_min: 105.000 temp1_alarm: 0.000 Ch. 0 DIMM 1: temp2_input: 60.500 temp2_max: 120.000 temp2_min: 105.000 temp2_alarm: 0.000 Ch. 1 DIMM 0: temp3_input: 61.000 temp3_max: 124.000 temp3_min: 105.000 temp3_alarm: 0.000 Ch. 1 DIMM 1: temp4_input: 56.500 temp4_max: 124.000 temp4_min: 105.000 temp4_alarm: 0.000 Ch. 2 DIMM 0: temp5_input: 70.500 temp5_max: 124.000 temp5_min: 105.000 temp5_alarm: 0.000 Ch. 2 DIMM 1: temp6_input: 57.000 temp6_max: 124.000 temp6_min: 105.000 temp6_alarm: 0.000 Ch. 3 DIMM 0: temp7_input: 55.500 temp7_max: 120.000 temp7_min: 105.000 temp7_alarm: 0.000 Ch. 3 DIMM 1: temp8_input: 64.000 temp8_max: 124.000 temp8_min: 105.000 temp8_alarm: 0.000 coretemp-isa-0000 Adapter: ISA adapter Core 0: temp2_input: 50.000 temp2_max: 82.000 temp2_crit: 100.000 temp2_crit_alarm: 0.000 Core 1: temp3_input: 46.000 temp3_max: 82.000 temp3_crit: 100.000 temp3_crit_alarm: 0.000 Core 2: temp4_input: 49.000 temp4_max: 82.000 temp4_crit: 100.000 temp4_crit_alarm: 0.000 Core 3: temp5_input: 48.000 temp5_max: 82.000 temp5_crit: 100.000 temp5_crit_alarm: 0.000 coretemp-isa-0001 Adapter: ISA adapter Core 0: temp2_input: 54.000 temp2_max: 82.000 temp2_crit: 100.000 temp2_crit_alarm: 0.000 Core 1: temp3_input: 48.000 temp3_max: 82.000 temp3_crit: 100.000 temp3_crit_alarm: 0.000 Core 2: temp4_input: 48.000 temp4_max: 82.000 temp4_crit: 100.000 temp4_crit_alarm: 0.000 Core 3: temp5_input: 48.000 temp5_max: 82.000 temp5_crit: 100.000 temp5_crit_alarm: 0.000 

これが第一の出力に比べて読めなくなりますどこに参照していますか?だから、スタンドアロンコマンドを実行したときのデータのように、スクリプトで実行されているときのデータの出力をどのようにして出力するのですか。


+0

あなたのコードには、動作や完了したステートメントを正当化するループはありません.... –

答えて

0

Nevermind私はちょうど何をしているのに最適な時計センサーを使用しました。

関連する問題