From c2581789bd50a3e05cbe7e4104dddb3142706eb2 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Wed, 26 Mar 2014 23:21:58 +0000 Subject: [PATCH] for bsd without root privilege, cpu line starter was not showing, so fixed that. Ignore this if Linux. --- inxi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inxi b/inxi index 7b2e88c..bacbf65 100755 --- a/inxi +++ b/inxi @@ -815,8 +815,8 @@ main() initialize_data() { eval $LOGFS - BSD_VERSION=$( uname -s 2>/dev/null | tr '[A-Z]' '[a-z]' ) - + BSD_VERSION=$( uname -s 2>/dev/null ) + BSD_VERSION=${BSD_VERSION,,} # note: archbsd says they are a freebsd distro, so assuming it's the same as freebsd if [[ -z ${BSD_VERSION/*bsd*/} ]];then # GNU/kfreebsd will by definition have GNU tools like sed/grep @@ -5546,14 +5546,14 @@ get_hard_drive_data_advanced() # this is handles the new /sys data types first if [[ -e /sys/block/${a_temp_working[0]}/device/model ]];then temp_name="$( remove_erroneous_chars /sys/block/${a_temp_working[0]}/device/model )" - temp_name=$( tr ' ' '_' <<< $temp_name | cut -d '-' -f 1 ) + temp_name=$( cut -d '-' -f 1 <<< ${temp_name// /_} ) elif [[ ${#a_temp_scsi[@]} -gt 0 ]];then for (( j=0; j < ${#a_temp_scsi[@]}; j++ )) do ## ok, ok, it's incomprehensible, search /dev/disk/by-id for a line that contains the # discovered disk name AND ends with the correct identifier, sdx # get rid of whitespace for some drive names and ids, and extra data after - in name - temp_name=$( tr ' ' '_' <<< ${a_temp_scsi[$j]} | cut -d '-' -f 1 ) + temp_name=$( cut -d '-' -f 1 <<< ${a_temp_scsi[$j]// /_} ) sd_ls_by_id=$( grep -Em1 ".*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" ) if [[ -n $sd_ls_by_id ]];then @@ -9289,7 +9289,7 @@ print_cpu_data() local cpc_plural='' cpu_count_print='' model_plural='' cpu_data_string='' local cpu_physical_count='' cpu_core_count='' cpu_core_alpha='' cpu_type='' local cpu_2_data='' working_cpu='' - local line_starter='' multi_cpu_starter="${C1}Clock Speeds$SEP3${C2} " + local line_starter="CPU$SEP3" multi_cpu_starter="${C1}Clock Speeds$SEP3${C2} " ##print_screen_output "A_CPU_DATA[0]=\"${A_CPU_DATA[0]}\"" # Array A_CPU_DATA always has one extra element: max clockfreq found.