mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 00:47:47 +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
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.3.16
|
||||
#### version: 0.3.17
|
||||
#### Date: November 3 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||
|
@ -769,14 +769,14 @@ get_cpu_data()
|
|||
|
||||
IFS=$'\n'
|
||||
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!
|
||||
# Therefore PATCH to use [ \t]+ when TESTING!
|
||||
/^processor\t+:/ { nr = $NF }
|
||||
|
||||
/^model name|^cpu\t+:/ {
|
||||
modelName = $NF
|
||||
gsub(/,/," ",modelName)
|
||||
cpu[nr, "model"] = modelName
|
||||
gsub(/,/," ",$NF)
|
||||
cpu[nr, "model"] = $NF
|
||||
}
|
||||
|
||||
/^cpu MHz|^clock\t+:/ {
|
||||
|
@ -788,6 +788,7 @@ get_cpu_data()
|
|||
}
|
||||
|
||||
if ($NF > max) { max = $NF }
|
||||
gsub(/MHZ/,"",$NF) ## clears out for cell cpu
|
||||
cpu[nr, "speed"] = $NF
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue