mirror of
https://github.com/smxi/inxi.git
synced 2025-01-31 18:12:21 +00:00
tweaked some output for awk cpu detections for cell
This commit is contained in:
parent
8ca79e2118
commit
64a9f179e6
12
inxi
12
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 0.3.15
|
#### version: 0.3.16
|
||||||
#### Date: November 3 2008
|
#### Date: November 3 2008
|
||||||
########################################################################
|
########################################################################
|
||||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||||
|
@ -773,7 +773,11 @@ get_cpu_data()
|
||||||
# Therefore PATCH to use [ \t]+ when TESTING!
|
# Therefore PATCH to use [ \t]+ when TESTING!
|
||||||
/^processor\t+:/ { nr = $NF }
|
/^processor\t+:/ { nr = $NF }
|
||||||
|
|
||||||
/^model name|^cpu\t+:/ { cpu[nr, "model"] = $NF }
|
/^model name|^cpu\t+:/ {
|
||||||
|
modelName = $NF
|
||||||
|
gsub(/,/," ",modelName)
|
||||||
|
cpu[nr, "model"] = modelName
|
||||||
|
}
|
||||||
|
|
||||||
/^cpu MHz|^clock\t+:/ {
|
/^cpu MHz|^clock\t+:/ {
|
||||||
if (!min) {
|
if (!min) {
|
||||||
|
@ -1294,8 +1298,10 @@ calculate_multicore_data()
|
||||||
# handle weird error cases where it's not a number
|
# handle weird error cases where it's not a number
|
||||||
if [ -n "$( egrep '^[0-9\.,]+$' <<< $string_number )" ];then
|
if [ -n "$( egrep '^[0-9\.,]+$' <<< $string_number )" ];then
|
||||||
string_number=$( echo $string_number $2 | awk '{total = $1*$2; print total}' )
|
string_number=$( echo $string_number $2 | awk '{total = $1*$2; print total}' )
|
||||||
|
elif [ "$string_number" == '' ];then
|
||||||
|
string_number='Not Available'
|
||||||
else
|
else
|
||||||
string_number="Error: string_number=$string_number "
|
string_number="Error data:$string_number "
|
||||||
fi
|
fi
|
||||||
echo "$string_number$string_data"
|
echo "$string_number$string_data"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue