totally synced separators in output, now if in console, uses : universally, or if color scheme is 0.

This is set dynamically as well. For irc it uses no : except for line starters and item starters, like:
ID: or IF: or 1: and so on. Also made cpu per core clock speed the same, using now 1: instead of (1)

that saves one character too per core, but makes it all the same, consistent.

This also now becomes a user adjustable parameter, via config files, can set irc/console separator character(s)

Ok, bored, now on with the day.
This commit is contained in:
inxi-svn 2011-07-08 19:55:04 +00:00
parent fb7467ea5a
commit 2627e355d5

205
inxi
View file

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.7.14 #### version: 1.7.15
#### Date: July 6 2011 #### Date: July 6 2011
#### Patch Number: 01 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -241,6 +241,9 @@ B_ROOT='false'
B_RUN_COLOR_SELECTOR='false' B_RUN_COLOR_SELECTOR='false'
# Running in a shell? Defaults to false, and is determined later. # Running in a shell? Defaults to false, and is determined later.
B_RUNNING_IN_SHELL='false' B_RUNNING_IN_SHELL='false'
if tty >/dev/null;then
B_RUNNING_IN_SHELL='true'
fi
# this sets the debug buffer # this sets the debug buffer
B_SCRIPT_UP='false' B_SCRIPT_UP='false'
B_SHOW_ADVANCED_NETWORK='false' B_SHOW_ADVANCED_NETWORK='false'
@ -384,6 +387,11 @@ ORIGINAL_IFS="$IFS"
# These two determine separators in single line output, to force irc clients not to break off sections # These two determine separators in single line output, to force irc clients not to break off sections
SEP1='~' SEP1='~'
SEP2=' ' SEP2=' '
# these will assign a separator to non irc states. Important! Using ':' can trigger stupid emoticon
# behaviors in output on IRC, so do not use those.
SEP3_IRC=''
SEP3_CONSOLE=':'
SEP3='' # do not set, will be set dynamically
### Script names/paths - must be non root writable ### Script names/paths - must be non root writable
SCRIPT_DATA_DIR="$HOME/.inxi" SCRIPT_DATA_DIR="$HOME/.inxi"
@ -616,6 +624,12 @@ main()
set_color_scheme $color_scheme set_color_scheme $color_scheme
fi fi
fi fi
# too hard to read if no colors, so force that for users on irc
if [[ $B_RUNNING_IN_SHELL == 'true' || $SCHEME == 0 ]];then
SEP3=$SEP3_CONSOLE
else
SEP3=$SEP3_IRC
fi
# all the pre-start stuff is in place now # all the pre-start stuff is in place now
B_SCRIPT_UP='true' B_SCRIPT_UP='true'
@ -1444,7 +1458,7 @@ check_recommends()
local Line='-----------------------------------------------------------------------------------------' local Line='-----------------------------------------------------------------------------------------'
local gawk_version='N/A' sed_version='N/A' sudo_version='N/A' python_version='N/A' local gawk_version='N/A' sed_version='N/A' sudo_version='N/A' python_version='N/A'
if ! tty >/dev/null;then if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
print_screen_output "Sorry, you can't run this option in an IRC client." print_screen_output "Sorry, you can't run this option in an IRC client."
exit 1 exit 1
fi fi
@ -2076,7 +2090,7 @@ show_options()
{ {
local color_scheme_count=$(( ${#A_COLOR_SCHEMES[@]} - 1 )) local color_scheme_count=$(( ${#A_COLOR_SCHEMES[@]} - 1 ))
if ! tty >/dev/null;then if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
print_screen_output "Sorry, you can't run the help option in an IRC client." print_screen_output "Sorry, you can't run the help option in an IRC client."
exit 1 exit 1
fi fi
@ -2248,10 +2262,9 @@ get_start_client()
local b_non_native_app='false' pppid='' app_working_name='' local b_non_native_app='false' pppid='' app_working_name=''
local b_qt4_konvi='false' local b_qt4_konvi='false'
if tty >/dev/null;then if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
IRC_CLIENT='Shell' IRC_CLIENT='Shell'
unset IRC_CLIENT_VERSION unset IRC_CLIENT_VERSION
B_RUNNING_IN_SHELL='true'
elif [[ -n $PPID && -f /proc/$PPID/exe ]];then elif [[ -n $PPID && -f /proc/$PPID/exe ]];then
if [[ $B_OVERRIDE_FILTER != 'true' ]];then if [[ $B_OVERRIDE_FILTER != 'true' ]];then
B_OUTPUT_FILTER='true' B_OUTPUT_FILTER='true'
@ -6166,7 +6179,7 @@ print_audio_data()
else else
alsa_version='N/A' alsa_version='N/A'
fi fi
alsa_data="${C1}Sound:${C2} $alsa ${C1}v:${C2} $alsa_version" alsa_data="${C1}Sound:${C2} $alsa ${C1}ver$SEP3${C2} $alsa_version"
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
fi fi
# note, error handling is done in the get function, so this will never be null, but # note, error handling is done in the get function, so this will never be null, but
@ -6195,13 +6208,13 @@ print_audio_data()
fi fi
# we're testing for the presence of the 2nd array item here, which is the driver name # we're testing for the presence of the 2nd array item here, which is the driver name
if [[ -n ${a_audio_working[1]} ]];then if [[ -n ${a_audio_working[1]} ]];then
alsa_driver=" ${C1}driver${C2} ${a_audio_working[1]}" alsa_driver=" ${C1}driver$SEP3${C2} ${a_audio_working[1]}"
fi fi
if [[ -n ${a_audio_working[2]} && $B_EXTRA_DATA == 'true' ]];then if [[ -n ${a_audio_working[2]} && $B_EXTRA_DATA == 'true' ]];then
if [[ $( wc -w <<< ${a_audio_working[2]} ) -gt 1 ]];then if [[ $( wc -w <<< ${a_audio_working[2]} ) -gt 1 ]];then
port_plural='s' port_plural='s'
fi fi
port_data=" ${C1}port$port_plural${C2} ${a_audio_working[2]}" port_data=" ${C1}port$port_plural$SEP3${C2} ${a_audio_working[2]}"
fi fi
if [[ -n ${a_audio_working[4]} && $B_EXTRA_DATA == 'true' ]];then if [[ -n ${a_audio_working[4]} && $B_EXTRA_DATA == 'true' ]];then
if [[ ${a_audio_working[1]} != 'USB Audio' ]];then if [[ ${a_audio_working[1]} != 'USB Audio' ]];then
@ -6210,10 +6223,10 @@ print_audio_data()
bus_usb_text='usb-ID' bus_usb_text='usb-ID'
fi fi
bus_usb_id=${a_audio_working[4]} bus_usb_id=${a_audio_working[4]}
pci_bus_id=" ${C1}$bus_usb_text:${C2} $bus_usb_id" pci_bus_id=" ${C1}$bus_usb_text$SEP3${C2} $bus_usb_id"
fi fi
if [[ -n ${a_audio_working[0]} ]];then if [[ -n ${a_audio_working[0]} ]];then
audio_data="${C1}Card$card_id${C2} ${a_audio_working[0]}$alsa_driver$port_data$pci_bus_id" audio_data="${C1}Card$card_id:${C2} ${a_audio_working[0]}$alsa_driver$port_data$pci_bus_id"
fi fi
# only print alsa on last line if short enough, otherwise print on its own line # only print alsa on last line if short enough, otherwise print on its own line
if [[ $i -eq 0 ]];then if [[ $i -eq 0 ]];then
@ -6294,7 +6307,7 @@ print_cpu_data()
# else # else
# bmip_data="${a_cpu_working[4]}" # bmip_data="${a_cpu_working[4]}"
# fi # fi
bmip_data=" ${C1}bmips${C2} $bmip_data" bmip_data=" ${C1}bmips$SEP3${C2} $bmip_data"
fi fi
## note: this handles how intel reports L2, total instead of per core like AMD does ## note: this handles how intel reports L2, total instead of per core like AMD does
# note that we need to multiply by number of actual cpus here to get true cache size # note that we need to multiply by number of actual cpus here to get true cache size
@ -6306,9 +6319,9 @@ print_cpu_data()
# only print shortened list # only print shortened list
if [[ $B_CPU_FLAGS_FULL != 'true' ]];then if [[ $B_CPU_FLAGS_FULL != 'true' ]];then
cpu_flags=$( process_cpu_flags "${a_cpu_working[3]}" ) cpu_flags=$( process_cpu_flags "${a_cpu_working[3]}" )
cpu_flags=" ${C1}flags${C2} ($cpu_flags)" cpu_flags=" ${C1}flags$SEP3${C2} ($cpu_flags)"
fi fi
cpu_data="$cpu_data${C2} ${C1}cache${C2} $cpu_cache$cpu_flags$bmip_data${CN}" cpu_data="$cpu_data${C2} ${C1}cache$SEP3${C2} $cpu_cache$cpu_flags$bmip_data${CN}"
fi fi
# we don't this printing out extra line unless > 1 cpu core # we don't this printing out extra line unless > 1 cpu core
if [[ ${#A_CPU_DATA[@]} -gt 2 && $B_SHOW_CPU == 'true' ]];then if [[ ${#A_CPU_DATA[@]} -gt 2 && $B_SHOW_CPU == 'true' ]];then
@ -6328,7 +6341,7 @@ print_cpu_data()
a_cpu_working=(${A_CPU_DATA[i]}) a_cpu_working=(${A_CPU_DATA[i]})
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
# note: the first iteration will create a first space, for color code separation below # note: the first iteration will create a first space, for color code separation below
cpu_multi_clock_data="$cpu_multi_clock_data ${C1}($(( i + 1 )))${C2} ${a_cpu_working[1]} MHz${CN}" cpu_multi_clock_data="$cpu_multi_clock_data ${C1}$(( i + 1 )):${C2} ${a_cpu_working[1]} MHz${CN}"
# someone actually appeared with a 16 core system, so going to stop the cpu core throttle # someone actually appeared with a 16 core system, so going to stop the cpu core throttle
# if this had some other purpose which we can't remember we'll add it back in # if this had some other purpose which we can't remember we'll add it back in
#if [[ $i -gt 10 ]];then #if [[ $i -gt 10 ]];then
@ -6368,7 +6381,7 @@ print_cpu_flags_full()
for (( i=0; i < ${#a_cpu_flags[@]};i++ )) for (( i=0; i < ${#a_cpu_flags[@]};i++ ))
do do
if [[ $i -eq 0 ]];then if [[ $i -eq 0 ]];then
line_starter="${C1}CPU Flags${C2} " line_starter="${C1}CPU Flags$SEP3${C2} "
else else
line_starter='' line_starter=''
fi fi
@ -6443,7 +6456,7 @@ print_gfx_data()
if [[ ${#A_GRAPHIC_DRIVERS[@]} -gt 1 ]];then if [[ ${#A_GRAPHIC_DRIVERS[@]} -gt 1 ]];then
x_driver_plural='s' x_driver_plural='s'
fi fi
x_driver_string="${C1}driver$x_driver_plural${C2}$x_driver " x_driver_string="${C1}driver$x_driver_plural$SEP3${C2}$x_driver "
# some basic error handling: # some basic error handling:
if [[ -z $screen_resolution ]];then if [[ -z $screen_resolution ]];then
@ -6452,7 +6465,7 @@ print_gfx_data()
if [[ -z $x_vendor || -z $x_version ]];then if [[ -z $x_vendor || -z $x_version ]];then
x_vendor_string="${C1}X-Vendor:${C2} N/A " x_vendor_string="${C1}X-Vendor:${C2} N/A "
else else
x_vendor_string="${C1}$x_vendor${C2} $x_version " x_vendor_string="${C1}$x_vendor$SEP3${C2} $x_version "
fi fi
if [[ $B_ROOT == 'true' ]];then if [[ $B_ROOT == 'true' ]];then
@ -6470,7 +6483,7 @@ print_gfx_data()
root_x_string="${C1}Advanced Data:${C2} N/A $root_x_string" root_x_string="${C1}Advanced Data:${C2} N/A $root_x_string"
fi fi
display_full_string="$x_vendor_string$x_driver_string${C1}${res_tty}${C2} ${screen_resolution} $root_x_string" display_full_string="$x_vendor_string$x_driver_string${C1}${res_tty}$SEP3${C2} ${screen_resolution} $root_x_string"
if [[ ${#A_GFX_CARD_DATA[@]} -gt 0 ]];then if [[ ${#A_GFX_CARD_DATA[@]} -gt 0 ]];then
for (( i=0; i < ${#A_GFX_CARD_DATA[@]}; i++ )) for (( i=0; i < ${#A_GFX_CARD_DATA[@]}; i++ ))
@ -6482,9 +6495,9 @@ print_gfx_data()
gfx_card_data=${a_gfx_working[0]} gfx_card_data=${a_gfx_working[0]}
if [[ $B_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_DATA == 'true' ]];then
if [[ -n ${a_gfx_working[1]} ]];then if [[ -n ${a_gfx_working[1]} ]];then
gfx_bus_id=" ${C1}bus-ID:${C2} ${a_gfx_working[1]}" gfx_bus_id=" ${C1}bus-ID$SEP3${C2} ${a_gfx_working[1]}"
else else
gfx_bus_id=" ${C1}bus-ID:${C2} N/A" gfx_bus_id=" ${C1}bus-ID$SEP3${C2} N/A"
fi fi
fi fi
if [[ ${#A_GFX_CARD_DATA[@]} -gt 1 ]];then if [[ ${#A_GFX_CARD_DATA[@]} -gt 1 ]];then
@ -6532,9 +6545,9 @@ print_gfx_data()
glx_direct_render='N/A' glx_direct_render='N/A'
fi fi
if [[ $B_HANDLE_CORRUPT_DATA == 'true' || $B_EXTRA_DATA == 'true' ]];then if [[ $B_HANDLE_CORRUPT_DATA == 'true' || $B_EXTRA_DATA == 'true' ]];then
direct_render_string=" ${C1}Direct Rendering${C2} ${glx_direct_render}${CN}" direct_render_string=" ${C1}Direct Rendering$SEP3${C2} ${glx_direct_render}${CN}"
fi fi
gfx_data="${C1}GLX Renderer${C2} ${glx_renderer} ${C1}GLX Version${C2} ${glx_version}${CN}$direct_render_string" gfx_data="${C1}GLX Renderer$SEP3${C2} ${glx_renderer} ${C1}GLX Version$SEP3${C2} ${glx_version}${CN}$direct_render_string"
gfx_data=$( create_print_line " " "$gfx_data" ) gfx_data=$( create_print_line " " "$gfx_data" )
print_screen_output "$gfx_data" print_screen_output "$gfx_data"
@ -6594,7 +6607,7 @@ print_hard_disk_data()
# printing line one, then new lines according to $divisor setting, and after, if leftovers, print that line. # printing line one, then new lines according to $divisor setting, and after, if leftovers, print that line.
case $i in case $i in
0) 0)
hdd_data=$( create_print_line "$Line_Starter" "${C1}HDD${C2} ${C1}Total Size:${C2} ${hdd_capacity} (${hdd_used}) ${hdd_model}" ) hdd_data=$( create_print_line "$Line_Starter" "${C1}HDD Total Size:${C2} ${hdd_capacity} (${hdd_used}) ${hdd_model}" )
print_screen_output "$hdd_data" print_screen_output "$hdd_data"
hdd_model='' hdd_model=''
Line_Starter=' ' Line_Starter=' '
@ -6648,28 +6661,28 @@ print_info_data()
gcc_installed='N/A' gcc_installed='N/A'
fi fi
if [[ $B_EXTRA_EXTRA_DATA == 'true' && -n ${A_GCC_VERSIONS[1]} ]];then if [[ $B_EXTRA_EXTRA_DATA == 'true' && -n ${A_GCC_VERSIONS[1]} ]];then
gcc_others=" ${C1}alt${C2} $( tr ',' '/' <<< ${A_GCC_VERSIONS[1]} )" gcc_others=" ${C1}alt$SEP3${C2} $( tr ',' '/' <<< ${A_GCC_VERSIONS[1]} )"
fi fi
gcc_installed="${C1}Gcc sys${C2} $gcc_installed$gcc_others " gcc_installed="${C1}Gcc sys$SEP3${C2} $gcc_installed$gcc_others "
fi fi
fi fi
# Some code could look superfluous but BitchX doesn't like lines not ending in a newline. F*&k that bitch! # Some code could look superfluous but BitchX doesn't like lines not ending in a newline. F*&k that bitch!
# long_last=$( echo -ne "${C1}Processes${C2} ${processes}${CN} | ${C1}Uptime${C2} ${up_time}${CN} | ${C1}Memory${C2} ${MEM}${CN}" ) # long_last=$( echo -ne "${C1}Processes$SEP3${C2} ${processes}${CN} | ${C1}Uptime$SEP3${C2} ${up_time}${CN} | ${C1}Memory$SEP3${C2} ${MEM}${CN}" )
info_data="${C1}Processes${C2} ${processes} ${C1}Uptime${C2} ${up_time} ${C1}Memory${C2} ${memory}${CN} " info_data="${C1}Processes$SEP3${C2} ${processes} ${C1}Uptime$SEP3${C2} ${up_time} ${C1}Memory$SEP3${C2} ${memory}${CN} "
# this only triggers if no X data is present or if extra data switch is on # this only triggers if no X data is present or if extra data switch is on
if [[ $B_SHOW_X_DATA != 'true' || $B_EXTRA_DATA == 'true' ]];then if [[ $B_SHOW_X_DATA != 'true' || $B_EXTRA_DATA == 'true' ]];then
runlvl="$( get_runlevel_data )" runlvl="$( get_runlevel_data )"
if [[ -n $runlvl ]];then if [[ -n $runlvl ]];then
info_data="${info_data}${C1}Runlevel${C2} ${runlvl} " info_data="${info_data}${C1}Runlevel$SEP3${C2} ${runlvl} "
fi fi
fi fi
if [[ $SHOW_IRC -gt 0 ]];then if [[ $SHOW_IRC -gt 0 ]];then
client_data="${C1}Client${C2} ${IRC_CLIENT}${IRC_CLIENT_VERSION} " client_data="${C1}Client$SEP3${C2} ${IRC_CLIENT}${IRC_CLIENT_VERSION} "
fi fi
info_data="${info_data}$gcc_installed" info_data="${info_data}$gcc_installed"
closing_data="$client_data${C1}$SCRIPT_NAME${C2} $SCRIPT_VERSION_NUMBER$script_patch_number${CN}" closing_data="$client_data${C1}$SCRIPT_NAME$SEP3${C2} $SCRIPT_VERSION_NUMBER$script_patch_number${CN}"
if [[ -n $info_data && $( calculate_line_length "$info_data$closing_data" ) -gt $LINE_MAX ]];then if [[ -n $info_data && $( calculate_line_length "$info_data$closing_data" ) -gt $LINE_MAX ]];then
info_data=$( create_print_line "$line_starter" "$info_data" ) info_data=$( create_print_line "$line_starter" "$info_data" )
print_screen_output "$info_data" print_screen_output "$info_data"
@ -6737,16 +6750,16 @@ print_machine_data()
chassis_vendor=" ${A_MACHINE_DATA[12]}" chassis_vendor=" ${A_MACHINE_DATA[12]}"
fi fi
if [[ -n ${A_MACHINE_DATA[13]} ]];then if [[ -n ${A_MACHINE_DATA[13]} ]];then
chassis_type=" ${C1}type${C2} ${A_MACHINE_DATA[13]}" chassis_type=" ${C1}type$SEP3${C2} ${A_MACHINE_DATA[13]}"
fi fi
if [[ -n ${A_MACHINE_DATA[14]} ]];then if [[ -n ${A_MACHINE_DATA[14]} ]];then
chassis_version=" ${C1}version${C2} ${A_MACHINE_DATA[14]}" chassis_version=" ${C1}version$SEP3${C2} ${A_MACHINE_DATA[14]}"
fi fi
if [[ -n ${A_MACHINE_DATA[15]} && $B_OUTPUT_FILTER != 'true' ]];then if [[ -n ${A_MACHINE_DATA[15]} && $B_OUTPUT_FILTER != 'true' ]];then
chassis_serial=" ${C1}serial${C2} ${A_MACHINE_DATA[15]}" chassis_serial=" ${C1}serial$SEP3${C2} ${A_MACHINE_DATA[15]}"
fi fi
if [[ -n "$chassis_vendor$chassis_type$chassis_version$chassis_serial" ]];then if [[ -n "$chassis_vendor$chassis_type$chassis_version$chassis_serial" ]];then
chassis_line="${C1}Chassis${C2}$chassis_vendor$chassis_type$chassis_version$chassis_serial" chassis_line="${C1}Chassis$SEP3${C2}$chassis_vendor$chassis_type$chassis_version$chassis_serial"
fi fi
fi fi
fi fi
@ -6761,10 +6774,10 @@ print_machine_data()
mobo_model='N/A' mobo_model='N/A'
fi fi
if [[ -n ${A_MACHINE_DATA[7]} ]];then if [[ -n ${A_MACHINE_DATA[7]} ]];then
mobo_version=" ${C1}version${C2} ${A_MACHINE_DATA[7]}" mobo_version=" ${C1}version$SEP3${C2} ${A_MACHINE_DATA[7]}"
fi fi
if [[ -n ${A_MACHINE_DATA[8]} && $B_OUTPUT_FILTER != 'true' ]];then if [[ -n ${A_MACHINE_DATA[8]} && $B_OUTPUT_FILTER != 'true' ]];then
mobo_serial=" ${C1}serial${C2} ${A_MACHINE_DATA[8]}" mobo_serial=" ${C1}serial$SEP3${C2} ${A_MACHINE_DATA[8]}"
fi fi
if [[ -n ${A_MACHINE_DATA[9]} ]];then if [[ -n ${A_MACHINE_DATA[9]} ]];then
bios_vendor=${A_MACHINE_DATA[9]} bios_vendor=${A_MACHINE_DATA[9]}
@ -6781,8 +6794,8 @@ print_machine_data()
else else
bios_date='N/A' bios_date='N/A'
fi fi
mobo_line="${C1}Mobo${C2} $mobo_vendor ${C1}model${C2} $mobo_model$mobo_version$mobo_serial" mobo_line="${C1}Mobo$SEP3${C2} $mobo_vendor ${C1}model$SEP3${C2} $mobo_model$mobo_version$mobo_serial"
bios_line="${C1}Bios${C2} $bios_vendor ${C1}version${C2} $bios_version ${C1}date${C2} $bios_date" bios_line="${C1}Bios$SEP3${C2} $bios_vendor ${C1}version$SEP3${C2} $bios_version ${C1}date$SEP3${C2} $bios_date"
if [[ $( calculate_line_length "$mobo_line$bios_line" ) -lt $LINE_MAX ]];then if [[ $( calculate_line_length "$mobo_line$bios_line" ) -lt $LINE_MAX ]];then
mobo_line="$mobo_line $bios_line" mobo_line="$mobo_line $bios_line"
bios_line='' bios_line=''
@ -6802,12 +6815,12 @@ print_machine_data()
product_name='N/A' product_name='N/A'
fi fi
if [[ -n ${A_MACHINE_DATA[2]} ]];then if [[ -n ${A_MACHINE_DATA[2]} ]];then
product_version=" ${C1}version${C2} ${A_MACHINE_DATA[2]}" product_version=" ${C1}version$SEP3${C2} ${A_MACHINE_DATA[2]}"
fi fi
if [[ -n ${A_MACHINE_DATA[3]} && $B_OUTPUT_FILTER != 'true' ]];then if [[ -n ${A_MACHINE_DATA[3]} && $B_OUTPUT_FILTER != 'true' ]];then
product_serial=" ${C1}serial${C2} ${A_MACHINE_DATA[3]} " product_serial=" ${C1}serial$SEP3${C2} ${A_MACHINE_DATA[3]} "
fi fi
system_line="${C1}System${C2} $system_vendor ${C1}product${C2} $product_name$product_version$product_serial" system_line="${C1}System$SEP3${C2} $system_vendor ${C1}product$SEP3${C2} $product_name$product_version$product_serial"
if [[ -n $chassis_line && $( calculate_line_length "$system_line$chassis_line" ) -lt $LINE_MAX ]];then if [[ -n $chassis_line && $( calculate_line_length "$system_line$chassis_line" ) -lt $LINE_MAX ]];then
system_line="$system_line $chassis_line" system_line="$system_line $chassis_line"
chassis_line='' chassis_line=''
@ -6865,7 +6878,7 @@ print_module_version()
done done
if [[ -n $module_versions ]];then if [[ -n $module_versions ]];then
echo " ${C1}v:${C2}$module_versions" echo " ${C1}ver$SEP3${C2}$module_versions"
fi fi
eval $LOGFE eval $LOGFE
} }
@ -6905,13 +6918,13 @@ print_networking_data()
module_version=$( print_module_version "${a_network_working[1]}" ) module_version=$( print_module_version "${a_network_working[1]}" )
fi fi
if [[ -n ${a_network_working[1]} ]];then if [[ -n ${a_network_working[1]} ]];then
driver_data="${C1}driver${C2} ${a_network_working[1]}$module_version " driver_data="${C1}driver$SEP3${C2} ${a_network_working[1]}$module_version "
fi fi
if [[ -n ${a_network_working[2]} && $B_EXTRA_DATA == 'true' ]];then if [[ -n ${a_network_working[2]} && $B_EXTRA_DATA == 'true' ]];then
if [[ $( wc -w <<< ${a_network_working[2]} ) -gt 1 ]];then if [[ $( wc -w <<< ${a_network_working[2]} ) -gt 1 ]];then
port_plural='s' port_plural='s'
fi fi
port_data="${C1}port$port_plural${C2} ${a_network_working[2]} " port_data="${C1}port$port_plural$SEP3${C2} ${a_network_working[2]} "
fi fi
if [[ -n ${a_network_working[4]} && $B_EXTRA_DATA == 'true' ]];then if [[ -n ${a_network_working[4]} && $B_EXTRA_DATA == 'true' ]];then
if [[ -z $( grep '^usb-' <<< ${a_network_working[4]} ) ]];then if [[ -z $( grep '^usb-' <<< ${a_network_working[4]} ) ]];then
@ -6921,9 +6934,9 @@ print_networking_data()
bus_usb_text='usb-ID' bus_usb_text='usb-ID'
bus_usb_id=$( cut -d '-' -f '2-4' <<< ${a_network_working[4]} ) bus_usb_id=$( cut -d '-' -f '2-4' <<< ${a_network_working[4]} )
fi fi
pci_bus_id="${C1}$bus_usb_text:${C2} $bus_usb_id" pci_bus_id="${C1}$bus_usb_text$SEP3${C2} $bus_usb_id"
fi fi
card_string="${C1}Card$card_id${C2} ${a_network_working[0]} " card_string="${C1}Card$card_id$SEP3${C2} ${a_network_working[0]} "
card_data="$driver_data$port_data$pci_bus_id" card_data="$driver_data$port_data$pci_bus_id"
if [[ $( calculate_line_length "$card_string$card_data" ) -gt $LINE_MAX ]];then if [[ $( calculate_line_length "$card_string$card_data" ) -gt $LINE_MAX ]];then
network_data=$( create_print_line "$line_starter" "$card_string" ) network_data=$( create_print_line "$line_starter" "$card_string" )
@ -6971,11 +6984,11 @@ print_network_advanced_data()
speed=${a_network_working[7]} speed=${a_network_working[7]}
fi fi
fi fi
speed_string="${C1}speed:${C2} $speed " speed_string="${C1}speed$SEP3${C2} $speed "
if [[ -n ${a_network_working[8]} ]];then if [[ -n ${a_network_working[8]} ]];then
duplex=${a_network_working[8]} duplex=${a_network_working[8]}
fi fi
duplex_string="${C1}duplex:${C2} $duplex " duplex_string="${C1}duplex$SEP3${C2} $duplex "
fi fi
if [[ -n ${a_network_working[9]} ]];then if [[ -n ${a_network_working[9]} ]];then
if [[ $B_OUTPUT_FILTER == 'true' ]];then if [[ $B_OUTPUT_FILTER == 'true' ]];then
@ -6984,7 +6997,7 @@ print_network_advanced_data()
mac_id=${a_network_working[9]} mac_id=${a_network_working[9]}
fi fi
fi fi
network_data="${C1}IF:${C2} $if_id ${C1}state:${C2} $oper_state $speed_string$duplex_string${C1}mac:${C2} $mac_id" network_data="${C1}IF:${C2} $if_id ${C1}state$SEP3${C2} $oper_state $speed_string$duplex_string${C1}mac$SEP3${C2} $mac_id"
network_data=$( create_print_line " " "$network_data" ) network_data=$( create_print_line " " "$network_data" )
print_screen_output "$network_data" print_screen_output "$network_data"
@ -7030,7 +7043,7 @@ print_networking_ip_data()
if_ip=${a_interfaces_working[1]} if_ip=${a_interfaces_working[1]}
fi fi
fi fi
if_ip_string=" ${C1}ip${C2} $if_ip" if_ip_string=" ${C1}ip$SEP3${C2} $if_ip"
if [[ $B_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_DATA == 'true' ]];then
if [[ -n ${a_interfaces_working[3]} ]];then if [[ -n ${a_interfaces_working[3]} ]];then
if [[ $B_OUTPUT_FILTER == 'true' ]];then if [[ $B_OUTPUT_FILTER == 'true' ]];then
@ -7039,13 +7052,13 @@ print_networking_ip_data()
if_ipv6=${a_interfaces_working[3]} if_ipv6=${a_interfaces_working[3]}
fi fi
fi fi
if_ipv6_string=" ${C1}ip-v6${C2} $if_ipv6" if_ipv6_string=" ${C1}ip-v6$SEP3${C2} $if_ipv6"
fi fi
fi fi
if [[ -n ${a_interfaces_working[0]} ]];then if [[ -n ${a_interfaces_working[0]} ]];then
if_id=${a_interfaces_working[0]} if_id=${a_interfaces_working[0]}
fi fi
if_string="$wan_ip_data$if_string${C1}IF${C2} $if_id$if_ip_string$if_ipv6_string " if_string="$wan_ip_data$if_string${C1}IF$SEP3${C2} $if_id$if_ip_string$if_ipv6_string "
wan_ip_data='' wan_ip_data=''
if [[ $( calculate_line_length "$if_string" ) -gt $line_max ]];then if [[ $( calculate_line_length "$if_string" ) -gt $line_max ]];then
full_string=$( create_print_line " " "$if_string" ) full_string=$( create_print_line " " "$if_string" )
@ -7126,9 +7139,9 @@ print_optical_drive_data()
else else
rev='N/A' rev='N/A'
fi fi
rev=" ${C1}rev:${C2} $rev" rev=" ${C1}rev$SEP3${C2} $rev"
fi fi
drive_data="${C1}Optical${counter}:${C2} $drive_id ${C1}model:${C2} $vendor$rev ${C1}dev-links:${C2} $drive_links" drive_data="${C1}Optical${counter}:${C2} $drive_id ${C1}model$SEP3${C2} $vendor$rev ${C1}dev-links$SEP3${C2} $drive_links"
drive_data=$( create_print_line "$Line_Starter" "$drive_data" ) drive_data=$( create_print_line "$Line_Starter" "$drive_data" )
print_screen_output "$drive_data" print_screen_output "$drive_data"
Line_Starter=' ' Line_Starter=' '
@ -7155,7 +7168,7 @@ print_optical_drive_data()
else else
audio='no' audio='no'
fi fi
audio=" ${C1}audio:${C2} $audio" audio=" ${C1}audio$SEP3${C2} $audio"
if [[ -z ${a_drives[6]} ]];then if [[ -z ${a_drives[6]} ]];then
multisession='N/A' multisession='N/A'
elif [[ ${a_drives[6]} == 1 ]];then elif [[ ${a_drives[6]} == 1 ]];then
@ -7163,7 +7176,7 @@ print_optical_drive_data()
else else
multisession='no' multisession='no'
fi fi
multisession=" ${C1}multisession:${C2} $multisession" multisession=" ${C1}multisession$SEP3${C2} $multisession"
if [[ -z ${a_drives[11]} ]];then if [[ -z ${a_drives[11]} ]];then
dvd='N/A' dvd='N/A'
elif [[ ${a_drives[11]} == 1 ]];then elif [[ ${a_drives[11]} == 1 ]];then
@ -7177,7 +7190,7 @@ print_optical_drive_data()
else else
state="${a_drives[14]}" state="${a_drives[14]}"
fi fi
state=" ${C1}state:${C2} $state" state=" ${C1}state$SEP3${C2} $state"
fi fi
if [[ -n ${a_drives[9]} && ${a_drives[9]} == 1 ]];then if [[ -n ${a_drives[9]} && ${a_drives[9]} == 1 ]];then
rw_support='cd-r' rw_support='cd-r'
@ -7199,7 +7212,7 @@ print_optical_drive_data()
rw_support='none' rw_support='none'
fi fi
drive_data="${C1}Features: speed:${C2} $speed$multisession$audio ${C1}dvd:${C2} $dvd ${C1}rw:${C2} $rw_support$state" drive_data="${C1}Features: speed$SEP3${C2} $speed$multisession$audio ${C1}dvd$SEP3${C2} $dvd ${C1}rw$SEP3${C2} $rw_support$state"
drive_data=$( create_print_line "$Line_Starter" "$drive_data" ) drive_data=$( create_print_line "$Line_Starter" "$drive_data" )
print_screen_output "$drive_data" print_screen_output "$drive_data"
fi fi
@ -7231,7 +7244,7 @@ print_partition_data()
if [[ $B_SHOW_PARTITIONS_FULL == 'true' ]] || [[ ${a_partition_working[4]} == 'main' ]];then if [[ $B_SHOW_PARTITIONS_FULL == 'true' ]] || [[ ${a_partition_working[4]} == 'main' ]];then
if [[ -n ${a_partition_working[2]} ]];then if [[ -n ${a_partition_working[2]} ]];then
partition_used=" ${C1}used:${C2} ${a_partition_working[2]} (${a_partition_working[3]})" partition_used=" ${C1}used$SEP3${C2} ${a_partition_working[2]} (${a_partition_working[3]})"
else else
partition_used='' # reset partition used to null partition_used='' # reset partition used to null
fi fi
@ -7240,7 +7253,7 @@ print_partition_data()
else else
full_fs='N/A' # reset partition used to null full_fs='N/A' # reset partition used to null
fi fi
full_fs=" ${C1}fs:${C2} $full_fs" full_fs=" ${C1}fs$SEP3${C2} $full_fs"
# don't show user names in output # don't show user names in output
if [[ $B_SHOW_LABELS == 'true' || $B_SHOW_UUIDS == 'true' ]];then if [[ $B_SHOW_LABELS == 'true' || $B_SHOW_UUIDS == 'true' ]];then
@ -7256,14 +7269,14 @@ print_partition_data()
dev_remote='dev' dev_remote='dev'
part_dev='N/A' part_dev='N/A'
fi fi
full_dev=" ${C1}$dev_remote:${C2} $part_dev" full_dev=" ${C1}$dev_remote$SEP3${C2} $part_dev"
if [[ $B_SHOW_LABELS == 'true' && $dev_remote != 'remote' ]];then if [[ $B_SHOW_LABELS == 'true' && $dev_remote != 'remote' ]];then
if [[ -n ${a_partition_working[7]} ]];then if [[ -n ${a_partition_working[7]} ]];then
part_label="${a_partition_working[7]}" part_label="${a_partition_working[7]}"
else else
part_label='N/A' part_label='N/A'
fi fi
full_label=" ${C1}label:${C2} $part_label" full_label=" ${C1}label$SEP3${C2} $part_label"
fi fi
if [[ $B_SHOW_UUIDS == 'true' && $dev_remote != 'remote' ]];then if [[ $B_SHOW_UUIDS == 'true' && $dev_remote != 'remote' ]];then
if [[ -n ${a_partition_working[8]} ]];then if [[ -n ${a_partition_working[8]} ]];then
@ -7271,7 +7284,7 @@ print_partition_data()
else else
part_uuid='N/A' part_uuid='N/A'
fi fi
full_uuid=" ${C1}uuid:${C2} $part_uuid" full_uuid=" ${C1}uuid$SEP3${C2} $part_uuid"
fi fi
fi fi
if [[ $B_OUTPUT_FILTER == 'true' ]];then if [[ $B_OUTPUT_FILTER == 'true' ]];then
@ -7280,7 +7293,7 @@ print_partition_data()
partitionIdClean=${a_partition_working[0]} partitionIdClean=${a_partition_working[0]}
fi fi
# because these lines can vary widely, using dynamic length handling here # because these lines can vary widely, using dynamic length handling here
a_partition_data[$counter]="${a_partition_data[$counter]}${C1}ID:${C2}$partitionIdClean ${C1}size:${C2} ${a_partition_working[1]}$partition_used$full_fs$full_dev$full_label$full_uuid " a_partition_data[$counter]="${a_partition_data[$counter]}${C1}ID:${C2} $partitionIdClean ${C1}size$SEP3${C2} ${a_partition_working[1]}$partition_used$full_fs$full_dev$full_label$full_uuid "
if [[ $B_SHOW_LABELS == 'true' || $B_SHOW_UUIDS == 'true' ]] || [[ $( calculate_line_length "${a_partition_data[$counter]}" ) -gt $line_max ]];then if [[ $B_SHOW_LABELS == 'true' || $B_SHOW_UUIDS == 'true' ]] || [[ $( calculate_line_length "${a_partition_data[$counter]}" ) -gt $line_max ]];then
((counter++)) ((counter++))
fi fi
@ -7358,33 +7371,33 @@ print_ps_item()
# handle the converted app names, with ~..~ means it didn't have a path # handle the converted app names, with ~..~ means it didn't have a path
if [[ -n $( grep -E '^~.*~$' <<< ${a_ps_data[0]} ) ]];then if [[ -n $( grep -E '^~.*~$' <<< ${a_ps_data[0]} ) ]];then
app_daemon='daemon:' app_daemon='daemon'
else else
app_daemon='command:' app_daemon='command'
fi fi
app_name=" ${C1}$app_daemon${C2} ${a_ps_data[0]}" app_name=" ${C1}$app_daemon$SEP3${C2} ${a_ps_data[0]}"
if [[ ${a_ps_data[0]} != ${a_ps_data[2]} ]];then if [[ ${a_ps_data[0]} != ${a_ps_data[2]} ]];then
app_name="$app_name ${C1}(started by:${C2} ${a_ps_data[2]}${C1})${C2}" app_name="$app_name ${C1}(started by$SEP3${C2} ${a_ps_data[2]}${C1})${C2}"
fi fi
app_pid=" ${C1}pid:${C2} ${a_ps_data[6]}" app_pid=" ${C1}pid$SEP3${C2} ${a_ps_data[6]}"
# ${C1}user:${C2} ${a_ps_data[8]} # ${C1}user:${C2} ${a_ps_data[8]}
case $1 in case $1 in
cpu) cpu)
app_cpu=" ${C1}cpu:${C2} ${a_ps_data[4]}%" app_cpu=" ${C1}cpu$SEP3${C2} ${a_ps_data[4]}%"
if [[ $B_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_DATA == 'true' ]];then
extra_data=" ${C1}mem:${C2} ${a_ps_data[7]}MB (${a_ps_data[5]}%)${C2}" extra_data=" ${C1}mem$SEP3${C2} ${a_ps_data[7]}MB (${a_ps_data[5]}%)${C2}"
fi fi
;; ;;
mem) mem)
app_mem=" ${C1}mem:${C2} ${a_ps_data[7]}MB (${a_ps_data[5]}%)${C2}" app_mem=" ${C1}mem$SEP3${C2} ${a_ps_data[7]}MB (${a_ps_data[5]}%)${C2}"
if [[ $B_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_DATA == 'true' ]];then
extra_data=" ${C1}cpu:${C2} ${a_ps_data[4]}%" extra_data=" ${C1}cpu$SEP3${C2} ${a_ps_data[4]}%"
fi fi
;; ;;
esac esac
(( line_counter++ )) (( line_counter++ ))
count_nu="${C1}$line_counter -${C2}" count_nu="${C1}$line_counter:${C2}"
full_line="$count_nu$app_cpu$app_mem$app_name$app_pid$extra_data" full_line="$count_nu$app_cpu$app_mem$app_name$app_pid$extra_data"
ps_data=$( create_print_line " " "$full_line" ) ps_data=$( create_print_line " " "$full_line" )
print_screen_output "$ps_data" print_screen_output "$ps_data"
@ -7454,7 +7467,7 @@ print_repo_data()
print_script_version() print_script_version()
{ {
local script_patch_number=$( get_patch_version_string ) local script_patch_number=$( get_patch_version_string )
local script_version="${C1}$SCRIPT_NAME${C2} $SCRIPT_VERSION_NUMBER$script_patch_number${CN}" local script_version="${C1}$SCRIPT_NAME$SEP3${C2} $SCRIPT_VERSION_NUMBER$script_patch_number${CN}"
# great trick from: http://ideatrash.net/2011/01/bash-string-padding-with-sed.html # great trick from: http://ideatrash.net/2011/01/bash-string-padding-with-sed.html
# left pad: sed -e :a -e 's/^.\{1,80\}$/& /;ta' # left pad: sed -e :a -e 's/^.\{1,80\}$/& /;ta'
# right pad: sed -e :a -e 's/^.\{1,80\}$/ &/;ta' # right pad: sed -e :a -e 's/^.\{1,80\}$/ &/;ta'
@ -7497,17 +7510,17 @@ print_sensors_data()
else else
cpu_temp='N/A' cpu_temp='N/A'
fi fi
cpu_temp="${C1}System Temperatures: cpu:${C2} $cpu_temp " cpu_temp="${C1}System Temperatures: cpu$SEP3${C2} $cpu_temp "
if [[ -n ${a_sensors_working[1]} ]];then if [[ -n ${a_sensors_working[1]} ]];then
mobo_temp=${a_sensors_working[1]} mobo_temp=${a_sensors_working[1]}
else else
mobo_temp='N/A' mobo_temp='N/A'
fi fi
mobo_temp="${C1}mobo:${C2} $mobo_temp " mobo_temp="${C1}mobo$SEP3${C2} $mobo_temp "
if [[ -n ${a_sensors_working[2]} ]];then if [[ -n ${a_sensors_working[2]} ]];then
psu_temp="${C1}psu:${C2} ${a_sensors_working[2]} " psu_temp="${C1}psu$SEP3${C2} ${a_sensors_working[2]} "
fi fi
gpu_temp=$( get_gpu_temp_data ) gpu_temp=$( get_gpu_temp_data )
# dump the unneeded screen data for single gpu systems # dump the unneeded screen data for single gpu systems
@ -7515,7 +7528,7 @@ print_sensors_data()
gpu_temp=$( cut -d ':' -f 2 <<< $gpu_temp ) gpu_temp=$( cut -d ':' -f 2 <<< $gpu_temp )
fi fi
if [[ -n $gpu_temp ]];then if [[ -n $gpu_temp ]];then
gpu_temp="${C1}gpu:${C2} ${gpu_temp} " gpu_temp="${C1}gpu$SEP3${C2} ${gpu_temp} "
fi fi
;; ;;
# then the fan data from main fan array # then the fan data from main fan array
@ -7532,18 +7545,18 @@ print_sensors_data()
else else
cpu_fan='N/A' cpu_fan='N/A'
fi fi
cpu_fan="${C1}Fan Speeds (in rpm): cpu:${C2} $cpu_fan " cpu_fan="${C1}Fan Speeds (in rpm): cpu$SEP3${C2} $cpu_fan "
(( fan_count++ )) (( fan_count++ ))
;; ;;
1) 1)
if [[ -n ${a_sensors_working[1]} ]];then if [[ -n ${a_sensors_working[1]} ]];then
mobo_fan="${C1}mobo:${C2} ${a_sensors_working[1]} " mobo_fan="${C1}mobo$SEP3${C2} ${a_sensors_working[1]} "
(( fan_count++ )) (( fan_count++ ))
fi fi
;; ;;
2) 2)
if [[ -n ${a_sensors_working[2]} ]];then if [[ -n ${a_sensors_working[2]} ]];then
ps_fan="${C1}psu:${C2} ${a_sensors_working[2]} " ps_fan="${C1}psu$SEP3${C2} ${a_sensors_working[2]} "
(( fan_count++ )) (( fan_count++ ))
fi fi
;; ;;
@ -7552,9 +7565,9 @@ print_sensors_data()
fan_number=$(( $j - 2 )) # sys fans start on array key 5 fan_number=$(( $j - 2 )) # sys fans start on array key 5
# wrap after fan 6 total # wrap after fan 6 total
if [[ $fan_count -lt 7 ]];then if [[ $fan_count -lt 7 ]];then
sys_fans="$sys_fans${C1}sys-$fan_number:${C2} ${a_sensors_working[$j]} " sys_fans="$sys_fans${C1}sys-$fan_number$SEP3${C2} ${a_sensors_working[$j]} "
else else
sys_fans2="$sys_fans2${C1}sys-$fan_number:${C2} ${a_sensors_working[$j]} " sys_fans2="$sys_fans2${C1}sys-$fan_number$SEP3${C2} ${a_sensors_working[$j]} "
fi fi
(( fan_count++ )) (( fan_count++ ))
fi fi
@ -7571,9 +7584,9 @@ print_sensors_data()
fan_number=$(( $j + 1 )) # sys fans start on array key 5 fan_number=$(( $j + 1 )) # sys fans start on array key 5
# wrap after fan 6 total # wrap after fan 6 total
if [[ $fan_count -lt 7 ]];then if [[ $fan_count -lt 7 ]];then
sys_fans="$sys_fans${C1}fan-$fan_number:${C2} ${a_sensors_working[$j]} " sys_fans="$sys_fans${C1}fan-$fan_number$SEP3${C2} ${a_sensors_working[$j]} "
else else
sys_fans2="$sys_fans2${C1}fan-$fan_number:${C2} ${a_sensors_working[$j]} " sys_fans2="$sys_fans2${C1}fan-$fan_number$SEP3${C2} ${a_sensors_working[$j]} "
fi fi
(( fan_count++ )) (( fan_count++ ))
fi fi
@ -7631,11 +7644,11 @@ print_system_data()
desktop_environment="tty$tty_session" desktop_environment="tty$tty_session"
desktop_type='Console' desktop_type='Console'
fi fi
de_distro_string="${C1}$desktop_type${C2} $desktop_environment ${C1}Distro${C2} $distro" de_distro_string="${C1}$desktop_type${C2} $desktop_environment ${C1}Distro$SEP3${C2} $distro"
if [[ $B_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_DATA == 'true' ]];then
gcc_string=$( get_gcc_kernel_version ) gcc_string=$( get_gcc_kernel_version )
if [[ -n $gcc_string ]];then if [[ -n $gcc_string ]];then
gcc_string=", ${C1}gcc${C2} $gcc_string" gcc_string=", ${C1}gcc$SEP3${C2} $gcc_string"
fi fi
fi fi
# check for 64 bit first # check for 64 bit first
@ -7654,10 +7667,10 @@ print_system_data()
host_name='N/A' host_name='N/A'
fi fi
fi fi
host_string="${C1}Host${C2} $host_name " host_string="${C1}Host$SEP3${C2} $host_name "
system_data=$( create_print_line "System:" "${C1}Host${C2} $host_name ${C1}Kernel${C2}" ) system_data=$( create_print_line "System:" "$host_string$host_name ${C1}Kernel$SEP3${C2}" )
fi fi
host_kernel_string="$host_string${C1}Kernel${C2} $current_kernel$bits " host_kernel_string="$host_string${C1}Kernel$SEP3${C2} $current_kernel$bits "
if [[ $( calculate_line_length "$host_kernel_string$de_distro_string" ) -lt $LINE_MAX ]];then if [[ $( calculate_line_length "$host_kernel_string$de_distro_string" ) -lt $LINE_MAX ]];then
system_data="$host_kernel_string$de_distro_string" system_data="$host_kernel_string$de_distro_string"
system_data=$( create_print_line "System:" "$system_data" ) system_data=$( create_print_line "System:" "$system_data" )
@ -7698,23 +7711,23 @@ print_unmounted_partition_data()
else else
full_size=${a_unmounted_data[1]} full_size=${a_unmounted_data[1]}
fi fi
full_size="${C1}size:${C2} $full_size" full_size="${C1}size$SEP3${C2} $full_size"
if [[ -z ${a_unmounted_data[2]} ]];then if [[ -z ${a_unmounted_data[2]} ]];then
full_label='N/A' full_label='N/A'
else else
full_label=${a_unmounted_data[2]} full_label=${a_unmounted_data[2]}
fi fi
full_label="${C1}label:${C2} $full_label" full_label="${C1}label$SEP3${C2} $full_label"
if [[ -z ${a_unmounted_data[3]} ]];then if [[ -z ${a_unmounted_data[3]} ]];then
full_uuid='N/A' full_uuid='N/A'
else else
full_uuid=${a_unmounted_data[3]} full_uuid=${a_unmounted_data[3]}
fi fi
full_uuid="${C1}uuid:${C2} $full_uuid" full_uuid="${C1}uuid$SEP3${C2} $full_uuid"
if [[ -z ${a_unmounted_data[4]} ]];then if [[ -z ${a_unmounted_data[4]} ]];then
full_fs='' full_fs=''
else else
full_fs="${C1}fs:${C2} ${a_unmounted_data[4]}" full_fs="${C1}fs$SEP3${C2} ${a_unmounted_data[4]}"
fi fi
full_string="$full_dev $full_size $full_label $full_uuid $full_fs" full_string="$full_dev $full_size $full_label $full_uuid $full_fs"
if [[ $i -eq 0 ]];then if [[ $i -eq 0 ]];then