improved extra whitespace handling in cpu model filters, now all > 1 whitespace becomes a single ' '

This commit is contained in:
inxi-svn 2008-11-05 23:15:09 +00:00
parent 90779b6369
commit c21dfba13d

5
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.3.22 #### version: 0.3.23
#### Date: November 5 2008 #### Date: November 5 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
@ -810,9 +810,9 @@ get_cpu_data()
/^model name|^cpu\t+:/ { /^model name|^cpu\t+:/ {
gsub(/,/," ",$NF) gsub(/,/," ",$NF)
gsub(//,"",$NF)
gsub(/'"$A_NORMAL_BANS"'/, "", $NF ) gsub(/'"$A_NORMAL_BANS"'/, "", $NF )
gsub(/'"$A_CPU_BANS"'/, "", $NF ) gsub(/'"$A_CPU_BANS"'/, "", $NF )
gsub(/[ \t]+/," ",$NF)
cpu[nr, "model"] = $NF cpu[nr, "model"] = $NF
} }
@ -1270,6 +1270,7 @@ calculate_multicore_data()
echo "$string_number$string_data" echo "$string_number$string_data"
} }
# prints out shortened list of flags, the main ones of interest
# args: $1 - string of cpu flags to process # args: $1 - string of cpu flags to process
process_cpu_flags() process_cpu_flags()
{ {