mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
tweaking and testing how awk handles this, cleared out MHZ from cell cpu speed
This commit is contained in:
parent
64a9f179e6
commit
a3ceadd2e7
9
inxi
9
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 0.3.16
|
#### version: 0.3.17
|
||||||
#### 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
|
||||||
|
@ -769,14 +769,14 @@ get_cpu_data()
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
A_CPU_DATA=($(gawk -F': ' '
|
A_CPU_DATA=($(gawk -F': ' '
|
||||||
|
{ IGNORECASE=1 }
|
||||||
# TAKE NOTE: \t+ will work for /proc/cpuinfo, but SOME ARBITRARY FILE used for TESTING might contain SPACES!
|
# TAKE NOTE: \t+ will work for /proc/cpuinfo, but SOME ARBITRARY FILE used for TESTING might contain SPACES!
|
||||||
# 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+:/ {
|
/^model name|^cpu\t+:/ {
|
||||||
modelName = $NF
|
gsub(/,/," ",$NF)
|
||||||
gsub(/,/," ",modelName)
|
cpu[nr, "model"] = $NF
|
||||||
cpu[nr, "model"] = modelName
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/^cpu MHz|^clock\t+:/ {
|
/^cpu MHz|^clock\t+:/ {
|
||||||
|
@ -788,6 +788,7 @@ get_cpu_data()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($NF > max) { max = $NF }
|
if ($NF > max) { max = $NF }
|
||||||
|
gsub(/MHZ/,"",$NF) ## clears out for cell cpu
|
||||||
cpu[nr, "speed"] = $NF
|
cpu[nr, "speed"] = $NF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue