Just some small cleanups and code fixes

This commit is contained in:
inxi-svn 2008-11-05 06:16:33 +00:00
parent a88d133b72
commit f57394e296

12
inxi
View file

@ -5,7 +5,7 @@
#### Date: November 4 2008 #### Date: November 4 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
#### As time permits functionality and recoding will occur. #### As time permits functionality improvements and recoding will occur.
#### ####
#### inxi, the universal, portable, system info script for irc. #### inxi, the universal, portable, system info script for irc.
#### Tested with Irssi, Xchat, Konversation, BitchX, KSirc, ircII, #### Tested with Irssi, Xchat, Konversation, BitchX, KSirc, ircII,
@ -705,7 +705,7 @@ set_calculated_variables()
# Extra path variable to make execute failures less likely, merged below # Extra path variable to make execute failures less likely, merged below
local extra_paths="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" local extra_paths="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
# Detect X and set variable "X" accordingly # Detect X and set variable "B_X_RUNNING" accordingly
if [ -n "$DISPLAY" ];then if [ -n "$DISPLAY" ];then
B_X_RUNNING='true' B_X_RUNNING='true'
fi fi
@ -1409,7 +1409,7 @@ print_cpu_data()
# # Array CPU always has one element: max clockfreq found. Therefore -gt and not -ge # # Array CPU always has one element: max clockfreq found. Therefore -gt and not -ge
# unset cpu_core_count # unset cpu_core_count
# fi # fi
echo ${A_CPU_DATA[@]}
cpu_data=$( create_print_line "CPU:" "${C1}${cpu_core_count_string}${C2} ${a_cpu_working[0]}" ) cpu_data=$( create_print_line "CPU:" "${C1}${cpu_core_count_string}${C2} ${a_cpu_working[0]}" )
if [ "$VERBOSITY_LEVEL" -ge 3 ];then if [ "$VERBOSITY_LEVEL" -ge 3 ];then
# update for multicore, bogomips x core count. # update for multicore, bogomips x core count.
@ -1431,8 +1431,7 @@ print_cpu_data()
cpu_data="$cpu_data${C2} ${C1}cache${C2} $cpu_cache ${C1}flags${C2} ($CPU_FLAGS)$bmip_data${CN}" cpu_data="$cpu_data${C2} ${C1}cache${C2} $cpu_cache ${C1}flags${C2} ($CPU_FLAGS)$bmip_data${CN}"
fi fi
if [ "$VERBOSITY_LEVEL" -ge 5 -a "${#A_CPU_DATA[@]}" -gt 2 ] if [ "$VERBOSITY_LEVEL" -ge 5 -a "${#A_CPU_DATA[@]}" -gt 2 ];then
then
cpu_clock_speed='' # null < verbosity level 5 cpu_clock_speed='' # null < verbosity level 5
else else
cpu_data="$cpu_data ${C1}clocked at${C2} ${a_cpu_working[1]} MHz${CN}" cpu_data="$cpu_data ${C1}clocked at${C2} ${a_cpu_working[1]} MHz${CN}"
@ -1441,8 +1440,7 @@ print_cpu_data()
cpu_data="$cpu_data $cpu_clock_speed" cpu_data="$cpu_data $cpu_clock_speed"
print_screen_output "$cpu_data" print_screen_output "$cpu_data"
if [ "$VERBOSITY_LEVEL" -ge 5 -a "${#A_CPU_DATA[@]}" -gt 2 ] if [ "$VERBOSITY_LEVEL" -ge 5 -a "${#A_CPU_DATA[@]}" -gt 2 ];then
then
for (( i=0; i < ${#A_CPU_DATA[@]}-1; i++ )) for (( i=0; i < ${#A_CPU_DATA[@]}-1; i++ ))
do do
IFS="," IFS=","