From 64a9f179e66750fc659756a97cb3879e93a588f8 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 4 Nov 2008 04:45:02 +0000 Subject: [PATCH] tweaked some output for awk cpu detections for cell --- inxi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index 84892ca..c4ef309 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.3.15 +#### version: 0.3.16 #### Date: November 3 2008 ######################################################################## #### 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! /^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+:/ { if (!min) { @@ -1294,8 +1298,10 @@ calculate_multicore_data() # handle weird error cases where it's not a number if [ -n "$( egrep '^[0-9\.,]+$' <<< $string_number )" ];then string_number=$( echo $string_number $2 | awk '{total = $1*$2; print total}' ) + elif [ "$string_number" == '' ];then + string_number='Not Available' else - string_number="Error: string_number=$string_number " + string_number="Error data:$string_number " fi echo "$string_number$string_data" }