diff --git a/inxi b/inxi index 0435df2..b173308 100755 --- a/inxi +++ b/inxi @@ -54,7 +54,7 @@ #### * bash >=3.0 (bash); df, readlink, stty, tr, uname, wc (coreutils); #### gawk (gawk); grep (grep); lspci (pciutils); #### ps, uptime (procps); find (findutils) -#### * Also the proc filesystem should be present and mounted +#### * Also the proc filesystem should be present and mounted for Linux #### * Some features, like -M and -d will not work, or will work incompletely, #### if /sys is missing #### @@ -644,7 +644,7 @@ main() fi ## sometimes tput will trigger an error (mageia) if irc client if [[ $B_IRC == 'false' ]];then - if [[ -n $( type -p tput ) ]];then + if type -p tput &>/dev/null;then TERM_COLUMNS=$(tput cols) TERM_LINES=$(tput lines) fi @@ -813,9 +813,9 @@ initialize_data() BSD_VERSION=$( uname -s 2>/dev/null | tr '[A-Z]' '[a-z]' ) # note: archbsd says they are a freebsd distro, so assuming it's the same as freebsd - if [[ -n $( grep 'bsd' <<< "$BSD_VERSION" ) ]];then + if [[ *"bsd"* == "$BSD_VERSION" ]];then # GNU/kfreebsd will by definition have GNU tools like sed/grep - if [[ -n $( grep 'kfreebsd' <<< "$BSD_VERSION" ) ]];then + if [[ *"kfreebsd"* == "$BSD_VERSION" ]];then BSD_TYPE='debian-bsd' # debian gnu bsd else BSD_TYPE='bsd' # all other bsds @@ -888,7 +888,7 @@ initialize_data() B_XORG_LOG='true' else # Detect location of the Xorg log file - if [[ -n $( type -p xset ) ]]; then + if type -p xset &>/dev/null; then FILE_XORG_LOG=$( xset q 2>/dev/null | grep -i 'Log file' | gawk '{print $3}') if [[ -e $FILE_XORG_LOG ]];then B_XORG_LOG='true' @@ -981,22 +981,22 @@ check_recommended_apps() script_debugger "Suggestion: update to Bash v3.1 for optimal inxi output" fi # test for a few apps that bsds may not have after initial tests - if [[ -n $( type -p lspci ) ]];then + if type -p lspci &>/dev/null;then B_LSPCI='true' fi if [[ -n $BSD_TYPE ]];then - if [[ -n $( type -p sysctl ) ]];then + if type -p sysctl &>/dev/null;then B_SYSCTL='true' fi - if [[ -n $( type -p pciconf ) ]];then + if type -p pciconf &>/dev/null;then B_PCICONF='true' fi fi # now setting qdbus/dcop for first run, some systems can have both by the way - if [[ -n $( type -p qdbus ) ]];then + if type -p qdbus &>/dev/null;then B_QDBUS='true' fi - if [[ -n $( type -p dcop ) ]];then + if type -p dcop &>/dev/null;then B_DCOP='true' fi eval $LOGFE @@ -1007,7 +1007,7 @@ check_recommended_apps() check_required_apps() { eval $LOGFS - local app_name='' app_path='' + local app_name='' # bc removed from deps for now local depends="df gawk grep ps readlink tr uname uptime wc" @@ -1026,8 +1026,7 @@ check_required_apps() if [[ $B_RUNNING_IN_DISPLAY == 'true' ]];then for app_name in $x_apps do - app_path=$( type -p $app_name ) - if [[ -z $app_path ]];then + if ! type -p $app_path &>/dev/null;then script_debugger "Resuming in non X mode: $app_name not found. For package install advice run: $SCRIPT_NAME --recommends" B_SHOW_DISPLAY_DATA='false' break @@ -1039,8 +1038,7 @@ check_required_apps() for app_name in $depends do - app_path=$( type -p $app_name ) - if [[ -z $app_path ]];then + if ! type -p $app_path &>/dev/null;then error_handler 5 "$app_name" fi done @@ -1488,7 +1486,7 @@ script_self_updater() if [[ -f /usr/share/man/man8/inxi.8.gz ]];then print_screen_output "Updating man page location to man1." mv -f /usr/share/man/man8/inxi.8.gz /usr/share/man/man1/inxi.1.gz - if [[ -n $( type -p mandb ) ]];then + if type -p mandb &>/dev/null;then exec $( type -p mandb ) -q fi fi @@ -1798,20 +1796,20 @@ check_recommends_user_output() echo "the main languages and tools $SCRIPT_NAME uses. Python is only for debugging data collection." echo $Line echo "Bash version: $( bash --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU bash/ {print $4}' )" - if [[ -n $( type -p gawk ) ]];then + if type -p gawk &>/dev/null;then gawk_version=$( gawk --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU Awk/ {print $3}' ) fi - if [[ -n $( type -p sed ) ]];then + if type -p sed &>/dev/null;then sed_version=$( sed --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^GNU sed version/ {print $4}' ) if [[ -z $sed_version ]];then # note: bsd sed shows error with --version flag sed_version=$( sed --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^sed: illegal option/ {print "BSD sed"}' ) fi fi - if [[ -n $( type -p sudo ) ]];then + if type -p sudo &>/dev/null;then sudo_version=$( sudo -V 2>&1 | awk 'BEGIN {IGNORECASE=1} /^Sudo version/ {print $3}' ) fi - if [[ -n $( type -p python ) ]];then + if type -p python &>/dev/null;then python_version=$( python --version 2>&1 | awk 'BEGIN {IGNORECASE=1} /^Python/ {print $2}' ) fi echo "Gawk version: $gawk_version" @@ -3184,7 +3182,7 @@ set_perl_python_konvi() { if [[ -z $IRC_CLIENT_VERSION ]];then # this is a hack to try to show konversation if inxi is running but started via /cmd - if [[ -n $( grep -i 'konversation' <<< "$Ps_aux_Data" | grep -v 'grep' ) && $B_RUNNING_IN_DISPLAY == 'true' ]];then + if [[ -n $( grep -i 'konversation' <<< "$Ps_aux_Data" ) && $B_RUNNING_IN_DISPLAY == 'true' ]];then IRC_CLIENT='Konversation' IRC_CLIENT_VERSION=" $( konversation --version 2>/dev/null | gawk '/^Konversation/ {print $2}' )" B_CONSOLE_IRC='false' @@ -3399,13 +3397,12 @@ get_audio_data() get_audio_usb_data() { eval $LOGFS - local usb_proc_file='' array_count='' usb_data='' usb_id='' lsusb_path='' lsusb_data='' + local usb_proc_file='' array_count='' usb_data='' usb_id='' lsusb_data='' local a_temp='' IFS=$'\n' - lsusb_path=$( type -p lsusb ) - if [[ -n $lsusb_path ]];then - lsusb_data=$( $lsusb_path 2>/dev/null ) + if type -p lsusb &>/dev/null;then + lsusb_data=$( lsusb 2>/dev/null ) fi log_function_data 'raw' "usb_data:\n$lsusb_data" if [[ -n $lsusb_data ]];then @@ -3705,41 +3702,44 @@ get_cpu_data_bsd() if [[ $BSD_VERSION == 'openbsd' ]];then gawk_fs='=' fi - - IFS=$'\n' - A_CPU_DATA=( $( - gawk -F "$gawk_fs" -v cpuFlags="$bsd_cpu_flags" ' - BEGIN { - IGNORECASE=1 - cpuModel="" - cpuClock="" - cpuCache="" - cpuBogomips="" - cpuVendor="" - } - /^hw.model/ { - gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF ) - gsub(/'"$BAN_LIST_CPU"'/, "", $NF ) - sub(//,"",$NF) - sub(/[a-z]+-core/, "", $NF ) - gsub(/^ +| +$|\"/, "", $NF) - gsub(/ [ \t]+/, " ", $NF) - cpuModel=$NF - if ( cpuClock != "" ) { - exit + # avoid setting this for systems where you have no read/execute permissions + # might be cases where the dmesg boot file was readable but sysctl perms failed + if [[ -n $Sysctl_a_Data || -n $bsd_cpu_flags ]];then + IFS=$'\n' + A_CPU_DATA=( $( + gawk -F "$gawk_fs" -v cpuFlags="$bsd_cpu_flags" ' + BEGIN { + IGNORECASE=1 + cpuModel="" + cpuClock="" + cpuCache="" + cpuBogomips="" + cpuVendor="" } - } - /^hw.(clock|cpuspeed)/ { - cpuClock=$NF - if ( cpuModel != "" ) { - exit + /^hw.model/ { + gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF ) + gsub(/'"$BAN_LIST_CPU"'/, "", $NF ) + sub(//,"",$NF) + sub(/[a-z]+-core/, "", $NF ) + gsub(/^ +| +$|\"/, "", $NF) + gsub(/ [ \t]+/, " ", $NF) + cpuModel=$NF + if ( cpuClock != "" ) { + exit + } } - } - END { - print cpuModel "," cpuClock "," cpuCache "," cpuFlags "," cpuBogomips "," cpuVendor - print "N/A" - }' <<< "$Sysctl_a_Data" ) ) - IFS="$ORIGINAL_IFS" + /^hw.(clock|cpuspeed)/ { + cpuClock=$NF + if ( cpuModel != "" ) { + exit + } + } + END { + print cpuModel "," cpuClock "," cpuCache "," cpuFlags "," cpuBogomips "," cpuVendor + print "N/A" + }' <<< "$Sysctl_a_Data" ) ) + IFS="$ORIGINAL_IFS" + fi eval $LOGFE } @@ -3748,27 +3748,30 @@ get_cpu_flags_bsd() { eval $LOGFS - local cpu_flags=$( gawk -F '=' ' - BEGIN { - IGNORECASE=1 - cpuFlags="" - } - /^CPU:/ { - while ( getline && !/memory/ ) { - if ( $1 ~ /Features/ ) { - # clean up odd stuff like - gsub(/<[a-z0-9]+>/,"", $2) - # all the flags are contained within < ... > on freebsd at least - gsub(/.*<|>.*/,"", $2) - gsub(/,/," ", $2) - cpuFlags = cpuFlags " " $2 - } - } - cpuFlags=tolower(cpuFlags) - print cpuFlags - exit - }' <<< "$Dmesg_Boot_Data" ) + local cpu_flags='' + if [[ -n $Dmesg_Boot_Data ]];then + cpu_flags=$( gawk -F '=' ' + BEGIN { + IGNORECASE=1 + cpuFlags="" + } + /^CPU:/ { + while ( getline && !/memory/ ) { + if ( $1 ~ /Features/ ) { + # clean up odd stuff like + gsub(/<[a-z0-9]+>/,"", $2) + # all the flags are contained within < ... > on freebsd at least + gsub(/.*<|>.*/,"", $2) + gsub(/,/," ", $2) + cpuFlags = cpuFlags " " $2 + } + } + cpuFlags=tolower(cpuFlags) + print cpuFlags + exit + }' <<< "$Dmesg_Boot_Data" ) + fi echo $cpu_flags log_function_data "$cpu_flags" eval $LOGFE @@ -4002,7 +4005,7 @@ get_desktop_environment() fi # did we find it? If not, start the xprop tests if [[ -z $desktop_environment ]];then - if [[ -n $( type -p xprop ) ]];then + if type -p xprop &>/dev/null;then xprop_root="$( xprop -root 2>/dev/null )" fi # note that cinnamon split from gnome, and and can now be id'ed via xprop, @@ -4038,9 +4041,9 @@ get_desktop_environment() # note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out # https://bugzilla.gnome.org/show_bug.cgi?id=542880 elif [[ -n $GNOME_DESKTOP_SESSION_ID ]]; then - if [[ -n $( type -p gnome-shell ) ]];then + if type -p gnome-shell &>/dev/null;then version=$( get_de_app_version 'gnome-shell' 'gnome' '3' ) - elif [[ -n $( type -p gnome-about ) ]];then + elif type -p gnome-about &>/dev/null;then version=$( get_de_app_version 'gnome-about' 'gnome' '3' ) fi if [[ $B_EXTRA_DATA == 'true' ]];then @@ -4091,7 +4094,7 @@ get_desktop_environment() fi desktop_environment="Xfce" elif [[ -n $( grep -is 'BLACKBOX_PID' <<< "$xprop_root" ) ]];then - if [[ -n $( grep -is 'fluxbox' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + if [[ -n $( grep -is 'fluxbox' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'fluxbox' '^fluxbox' '2' ) desktop_environment='Fluxbox' else @@ -4101,12 +4104,12 @@ get_desktop_environment() # note: openbox-lxde --version may be present, but returns openbox data version=$( get_de_app_version 'openbox' '^openbox' '2' ) if [[ $XDG_CURRENT_DESKTOP == 'LXDE' || \ - -n $( grep -is 'lxde' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + -n $( grep -is 'lxde' <<< "$Ps_aux_Data" ) ]];then if [[ -n $version ]];then version="(Openbox $version)" fi desktop_environment='LXDE' - elif [[ -n $( grep -is 'razor-desktop' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -is 'razor-desktop' <<< "$Ps_aux_Data" ) ]];then if [[ -n $version ]];then version="(Openbox $version)" fi @@ -4151,37 +4154,37 @@ get_desktop_environment() # a few manual hacks for things that don't id with xprop, these are just good guesses # note that gawk is going to exit after first occurance of search string, so no need for extra if [[ -z $desktop_environment ]];then - if [[ -n $( grep -is 'fvwm-crystal' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + if [[ -n $( grep -is 'fvwm-crystal' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'fvwm' '^fvwm' '2' ) desktop_environment='FVWM-Crystal' - elif [[ -n $( grep -is 'fvwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -is 'fvwm' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'fvwm' '^fvwm' '2' ) desktop_environment='FVWM' - elif [[ -n $( grep -is 'pekwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -is 'pekwm' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'pekwm' '^pekwm' '3' ) desktop_environment='pekwm' - elif [[ -n $( grep -is 'awesome' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -is 'awesome' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'awesome' '^awesome' '2' ) desktop_environment='Awesome' - elif [[ -n $( grep -is 'scrotwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -is 'scrotwm' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'scrotwm' '^welcome.*scrotwm' '4' ) desktop_environment='Scrotwm' # no --version for this one - elif [[ -n $( grep -is 'spectrwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -is 'spectrwm' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'spectrwm' '^spectrwm.*welcome.*spectrwm' '5' ) desktop_environment='Spectrwm' # no --version for this one - elif [[ -n $( grep -Eis '([[:space:]]|/)twm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -Eis '([[:space:]]|/)twm' <<< "$Ps_aux_Data" ) ]];then desktop_environment='Twm' # no --version for this one - elif [[ -n $( grep -Eis '([[:space:]]|/)dwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -Eis '([[:space:]]|/)dwm' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'dwm' '^dwm' '1' ) desktop_environment='dwm' - elif [[ -n $( grep -is 'wmii2' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -is 'wmii2' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'wmii2' '^wmii2' '1' ) desktop_environment='wmii2' # note: in debian at least, wmii is actuall wmii3 - elif [[ -n $( grep -is 'wmii' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -is 'wmii' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'wmii' '^wmii' '1' ) desktop_environment='wmii' - elif [[ -n $( grep -Eis '([[:space:]]|/)jwm' <<< "$Ps_aux_Data" | grep -v 'grep' ) ]];then + elif [[ -n $( grep -Eis '([[:space:]]|/)jwm' <<< "$Ps_aux_Data" ) ]];then version=$( get_de_app_version 'jwm' '^jwm' '2' ) desktop_environment='JWM' fi @@ -4221,7 +4224,7 @@ get_de_app_version() ;; # quick debian/buntu hack until I find a universal way to get version for these dash) - if [[ -n $( type -p dpkg ) ]];then + if type -p dpkg &>/dev/null;then version_data="$( dpkg -l $1 2>/dev/null )" fi ;; @@ -4279,7 +4282,7 @@ get_de_gtk_data() # this is a hack, and has to be changed with every toolkit version change, and only dev systems # have this installed, but it's a cross distro command so let's test it first - if [[ -n $( type -p pkg-config ) ]];then + if type -p pkg-config &>/dev/null;then toolkit=$( pkg-config --modversion gtk+-4.0 2>/dev/null ) # note: opensuse gets null output here, we need the command to get version and output sample if [[ -z $toolkit ]];then @@ -4294,7 +4297,7 @@ get_de_gtk_data() # we'll try some known package managers next. dpkg will handle a lot of distros # this is the most likely order as of: 2014-01-13. Not going to try to support all package managers # too much work, just the very biggest ones. - if [[ -n $( type -p dpkg ) ]];then + if type -p dpkg &>/dev/null;then toolkit=$( dpkg -s libgtk-3-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' ) if [[ -z $toolkit ]];then toolkit=$( dpkg -s libgtk2.0-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' ) @@ -4303,7 +4306,7 @@ get_de_gtk_data() if [[ -z $toolkit ]];then toolkit=$( dpkg -s libgtk-4-0 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' ) fi - elif [[ -n $( type -p pacman ) ]];then + elif type -p pacman &>/dev/null;then toolkit=$( pacman -Qi gtk3 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' ) if [[ -z $toolkit ]];then toolkit=$( pacman -Qi gtk2 2>/dev/null | gawk -F ':' '/^Version/ {print $2}' ) @@ -4557,7 +4560,7 @@ get_distro_lsb_os_release_data() ;; lsb-app) # this is HORRIBLY slow, not using - if [[ -n $( type -p lsb_release ) ]];then + if type -p lsb_release &>/dev/null;then distro=$( echo "$( lsb_release -irc )" | gawk -F ':' ' BEGIN { IGNORECASE=1 @@ -4739,7 +4742,8 @@ get_dmesg_boot_data() if [[ $B_DMESG_BOOT_FILE == 'true' ]];then # replace all indented items with ~ so we can id them easily while processing - dmsg_boot_data="$( cat $FILE_DMESG_BOOT | sed $SED_RX 's/"//g' )" + # note that if user, may get error of read permissions + dmsg_boot_data="$( cat $FILE_DMESG_BOOT 2>/dev/null | sed $SED_RX 's/"//g' )" fi echo "$dmsg_boot_data" # log_function_data "$dmsg_boot_data" @@ -4801,21 +4805,26 @@ get_gpu_temp_data() local gpu_temp='' gpu_fan='' screens='' screen_nu='' gpu_temp_looper='' # we'll try for nvidia/ati, then add if more are shown - if [[ -n $( type -p nvidia-settings ) ]];then - # first get the number of screens - screens=$( nvidia-settings -q screens | gawk ' - /:[0-9]\.[0-9]/ { - screens=screens gensub(/(.*)(:[0-9]\.[0-9])(.*)/, "\\2", "1", $0) " " - } - END { - print screens - } - ' ) + if type -p nvidia-settings &>/dev/null;then + # first get the number of screens. This only work if you are in X + if [[ $B_RUNNING_IN_DISPLAY == 'true' ]];then + screens=$( nvidia-settings -q screens | gawk ' + /:[0-9]\.[0-9]/ { + screens=screens gensub(/(.*)(:[0-9]\.[0-9])(.*)/, "\\2", "1", $0) " " + } + END { + print screens + } + ' ) + else + # do a guess, this will work for most users, it's better than nothing for out of X + screens=':0.0' + fi # now we'll get the gpu temp for each screen discovered. The print out function # will handle removing screen data for single gpu systems for screen_nu in $screens do - gpu_temp_looper=$( nvidia-settings -c $screen_nu -q GPUCoreTemp | gawk -F ': ' ' + gpu_temp_looper=$( nvidia-settings -c $screen_nu -q GPUCoreTemp 2>/dev/null | gawk -F ': ' ' BEGIN { IGNORECASE=1 gpuTemp="" @@ -4833,7 +4842,7 @@ get_gpu_temp_data() screen_nu=$( cut -d ':' -f 2 <<< $screen_nu ) gpu_temp="$gpu_temp$screen_nu:$gpu_temp_looper " done - elif [[ -n $( type -p aticonfig ) ]];then + elif type -p aticonfig &>/dev/null;then # gpu_temp=$( aticonfig --adapter=0 --od-gettemperature | gawk -F ': ' ' gpu_temp=$( aticonfig --adapter=all --od-gettemperature | gawk -F ': ' ' BEGIN { @@ -5215,13 +5224,13 @@ get_graphics_display_server_version() eval $LOGFS local version='' x_data='' # note that some users can have /usr/bin/Xorg but not /usr/bin/X - if [[ -n $( type -p X ) ]];then + if type -p X &>/dev/null;then # note: MUST be this syntax: X -version 2>&1 # otherwise X -version overrides everything and this comes out null. # two knowns id strings: X.Org X Server 1.7.5 AND X Window System Version 1.7.5 #X -version 2>&1 | gawk '/^X Window System Version/ { print $5 }' x_data="$( X -version 2>&1 )" - elif [[ -n $( type -p Xorg ) ]];then + elif type -p Xorg &>/dev/null;then x_data="$( Xorg -version 2>&1)" fi if [[ -n $x_data ]];then @@ -5589,11 +5598,13 @@ get_init_data() # more data may be needed for other init systems. if [[ -e /proc/1/comm && -n $( grep -s 'systemd' /proc/1/comm ) ]];then init_type='systemd' - if [[ -n $( type -p systemd ) ]];then + if type -p systemd &>/dev/null;then init_version=$( get_de_app_version 'systemd' '^systemd' '2' ) fi - if [[ -z $init_version && -n $( type -p systemctl ) ]];then - init_version=$( get_de_app_version 'systemctl' '^systemd' '2' ) + if [[ -z $init_version ]];then + if type -p systemctl &>/dev/null;then + init_version=$( get_de_app_version 'systemctl' '^systemd' '2' ) + fi fi else ls_run=$(ls /run) @@ -5602,7 +5613,7 @@ get_init_data() init_type='Upstart' # /sbin/init --version == init (upstart 1.12.1) init_version=$( get_de_app_version 'init' 'upstart' '3' ) - elif [[ -n $( type -p epoch ) ]];then + elif type -p epoch &>/dev/null;then init_type='Epoch' # epoch version == Epoch Init System 1.0.1 "Sage" init_version=$( get_de_app_version 'epoch' '^Epoch' '4' ) @@ -5613,7 +5624,7 @@ get_init_data() # no data on version yet elif [[ -f /etc/inittab ]];then init_type='SysVinit' - if [[ -n $( type -p strings ) ]];then + if type -p strings &>/dev/null;then strings_init_version="$( strings /sbin/init | grep -E 'version[[:space:]]+[0-9]' )" fi if [[ -n $strings_init_version ]];then @@ -5627,10 +5638,10 @@ get_init_data() if [[ -n $( grep 'openrc' <<< "$ls_run" ) ]];then rc_type='OpenRC' # /sbin/openrc --version == openrc (OpenRC) 0.13 - if [[ -n $( type -p openrc ) ]];then + if type -p openrc &>/dev/null;then rc_version=$( get_de_app_version 'openrc' '^openrc' '3' ) # /sbin/rc --version == rc (OpenRC) 0.11.8 (Gentoo Linux) - elif [[ -n $( type -p rc ) ]];then + elif type -p rc &>/dev/null;then rc_version=$( get_de_app_version 'rc' '^rc' '3' ) fi ## assume sysvrc, but this data is too buggy and weird and inconsistent to have meaning @@ -7813,7 +7824,7 @@ $repo_data_working" # echo and execute the line breaks inserted REPO_DATA="$( echo -e $repo_data_working )" # Mandriva/Mageia using: urpmq - elif [[ -n $( type -p urpmq ) ]];then + elif type -p urpmq &>/dev/null;then REPO_DATA="$( urpmq --list-media active --list-url )" # now we need to create the structure: repo info: repo path # we do that by looping through the lines of the output and then @@ -7864,9 +7875,9 @@ get_runlevel_data() { eval $LOGFS local runlvl='' - local runlevel_path=$( type -p runlevel ) - if [[ -n $runlevel_path ]];then - runlvl="$( $runlevel_path | gawk '{ print $2 }' )" + + if type -p runlevel &>/dev/null;then + runlvl="$( runlevel | gawk '{ print $2 }' )" fi echo $runlvl eval $LOGFE @@ -8250,10 +8261,10 @@ get_sensors_data() get_sensors_output() { - local sensors_path=$( type -p sensors ) sensors_data='' + local sensors_data='' - if [[ -n $sensors_path ]];then - sensors_data="$( $sensors_path 2>/dev/null )" + if type -p sensors &>/dev/null;then + sensors_data="$( sensors 2>/dev/null )" if [[ -n "$sensors_data" ]];then # make sure the file ends in newlines then characters, the newlines are lost in the echo unless # the data ends in some characters @@ -9173,19 +9184,19 @@ print_audio_data() fi if [[ -n $audio_data ]];then if [[ $( calculate_line_length "$card_string$audio_data" ) -lt $COLS_INNER ]];then - print_data=$( create_print_line "$line_starter" "$card_string$audio_data" ) + print_data=$( create_print_line "$line_starter" "$card_string$audio_data${CN}" ) print_screen_output "$print_data" # print the line else # keep the driver on the same line no matter what, looks weird alone on its own line if [[ $B_EXTRA_DATA != 'true' ]];then - print_data=$( create_print_line "$line_starter" "$card_string$audio_data" ) + print_data=$( create_print_line "$line_starter" "$card_string$audio_data${CN}" ) print_screen_output "$print_data" else - print_data=$( create_print_line "$line_starter" "$card_string" ) + print_data=$( create_print_line "$line_starter" "$card_string${CN}" ) print_screen_output "$print_data" line_starter=' ' - print_data=$( create_print_line "$line_starter" "$audio_data" ) + print_data=$( create_print_line "$line_starter" "$audio_data${CN}" ) print_screen_output "$print_data" fi fi @@ -9195,7 +9206,7 @@ print_audio_data() fi if [[ -n $alsa_data ]];then alsa_data=$( sed 's/ALSA/Advanced Linux Sound Architecture/' <<< $alsa_data ) - alsa_data=$( create_print_line "$line_starter" "$alsa_data" ) + alsa_data=$( create_print_line "$line_starter" "$alsa_data${CN}" ) print_screen_output "$alsa_data" fi eval $LOGFE @@ -9209,7 +9220,8 @@ print_cpu_data() local a_cpu_working='' cpu_model='' cpu_clock='' cpu_null_error='' 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='' line_starter='' + local cpu_2_data='' + local line_starter="CPU$cpc_plural:" ##print_screen_output "A_CPU_DATA[0]=\"${A_CPU_DATA[0]}\"" # Array A_CPU_DATA always has one extra element: max clockfreq found. @@ -9248,7 +9260,7 @@ print_cpu_data() cpu_count_print="$cpu_physical_count " model_plural='s' fi - line_starter="CPU$cpc_plural:" + cpu_data_string="$cpu_count_print$cpu_core_alpha core" cpu_data="${C1}$cpu_data_string${C2} ${a_cpu_working[0]}$model_plural ($cpu_type)" if [[ $B_SHOW_CPU == 'true' ]];then @@ -9297,17 +9309,17 @@ print_cpu_data() fi # arm cpus do not have flags or cache if [[ ${a_cpu_working[6]} != 'true' ]];then - cpu_data="$cpu_data${C2} ${C1}cache$SEP3${C2} $cpu_cache${CN}" - cpu_2_data="$cpu_flags$bmip_data${CN}" + cpu_data="$cpu_data${C2} ${C1}cache$SEP3${C2} $cpu_cache" + cpu_2_data="$cpu_flags$bmip_data" else - cpu_data="$cpu_data${C2} (ARM)$bmip_data${CN}" + cpu_data="$cpu_data${C2} (ARM)$bmip_data" fi fi # we don't this printing out extra line unless > 1 cpu core if [[ ${#A_CPU_DATA[@]} -gt 2 && $B_SHOW_CPU == 'true' ]];then cpu_clock_speed='' # null < verbosity level 5 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" fi cpu_2_data="$cpu_2_data$cpu_clock_speed" else @@ -9318,18 +9330,18 @@ print_cpu_data() fi # echo $cpu_data $cpu_2_data # echo ln: $( calculate_line_length "$cpu_data $cpu_2_data" ) -# echo cpl: $( create_print_line "$line_starter" "${cpu_2_data}" ): +# echo cpl: $( create_print_line "$line_starter" "$cpu_2_data${CN}" ): # echo icols: $COLS_INNER # echo tc: $TERM_COLUMNS # echo :${cpu_2_data}: if [[ -n $cpu_2_data && $( calculate_line_length "$cpu_data $cpu_2_data" ) -gt $COLS_INNER ]];then - cpu_data=$( create_print_line "$line_starter" "$cpu_data" ) + cpu_data=$( create_print_line "$line_starter" "$cpu_data${CN}" ) line_starter='' print_screen_output "$cpu_data" - cpu_data=$( create_print_line " " "$cpu_2_data" ) + cpu_data=$( create_print_line " " "$cpu_2_data${CN}" ) print_screen_output "$cpu_data" else - cpu_data=$( create_print_line "$line_starter" "$cpu_data" ) + cpu_data=$( create_print_line "$line_starter" "$cpu_data${CN}" ) print_screen_output "$cpu_data $cpu_2_data" fi # we don't this printing out extra line unless > 1 cpu core @@ -9341,7 +9353,7 @@ print_cpu_data() a_cpu_working=(${A_CPU_DATA[i]}) IFS="$ORIGINAL_IFS" # 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" # 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 [[ $i -gt 10 ]];then @@ -9349,7 +9361,7 @@ print_cpu_data() #fi done if [[ -n $cpu_multi_clock_data ]];then - cpu_multi_clock_data=$( create_print_line " " "${C1}Clock Speeds:${C2}$cpu_multi_clock_data" ) + cpu_multi_clock_data=$( create_print_line " " "${C1}Clock Speeds:${C2}$cpu_multi_clock_data${CN}" ) print_screen_output "$cpu_multi_clock_data" fi fi @@ -9483,22 +9495,21 @@ print_graphics_data() if [[ -z $driver ]];then driver=' N/A' fi - if [[ ${#A_GRAPHIC_DRIVERS[@]} -gt 1 ]];then driver_plural='s' fi - driver_string="${C1}driver$driver_plural$SEP3${C2}$driver " - # some basic error handling: if [[ -z $screen_resolution ]];then screen_resolution='N/A' fi + # note: fix this, we may find a display server that has no version if [[ -z $display_vendor || -z $display_version ]];then display_vendor_string="N/A" else display_vendor_string="$display_vendor $display_version" fi display_server_string="${C1}Display Server${SEP3}${C2} $display_vendor_string " + driver_string="${C1}driver$driver_plural$SEP3${C2}$driver " if [[ $B_ROOT == 'true' ]];then root_x_string='for root ' @@ -9549,7 +9560,7 @@ print_graphics_data() fi graphics_data="${C1}$card_id${C2} $card_data$card_bus_id$chip_id " if [[ ${#A_GRAPHICS_CARD_DATA[@]} -gt 1 ]];then - graphics_data=$( create_print_line "$line_starter" "$graphics_data" ) + graphics_data=$( create_print_line "$line_starter" "$graphics_data${CN}" ) print_screen_output "$graphics_data" line_starter=' ' graphics_data='' @@ -9560,14 +9571,14 @@ print_graphics_data() graphics_data="${C1}Card:${C2} Failed to Detect Video Card! " fi if [[ -n $graphics_data && $( calculate_line_length "$graphics_data$display_full_string" ) -lt $COLS_INNER ]];then - graphics_data=$( create_print_line "$line_starter" "$graphics_data$display_full_string" ) + graphics_data=$( create_print_line "$line_starter" "$graphics_data$display_full_string${CN}" ) else if [[ -n $graphics_data ]];then - graphics_data=$( create_print_line "$line_starter" "$graphics_data" ) + graphics_data=$( create_print_line "$line_starter" "$graphics_data${CN}" ) print_screen_output "$graphics_data" line_starter=' ' fi - graphics_data=$( create_print_line "$line_starter" "$display_full_string" ) + graphics_data=$( create_print_line "$line_starter" "$display_full_string${CN}" ) fi print_screen_output "$graphics_data" # if [[ -z $glx_renderer || -z $glx_version ]];then @@ -9587,10 +9598,10 @@ print_graphics_data() glx_direct_render='N/A' fi if [[ $B_HANDLE_CORRUPT_DATA == 'true' || $B_EXTRA_DATA == 'true' ]];then - direct_render_string=" ${C1}Direct Rendering$SEP3${C2} $glx_direct_render${CN}" + direct_render_string=" ${C1}Direct Rendering$SEP3${C2} $glx_direct_render" fi - graphics_data="${C1}GLX Renderer$SEP3${C2} $glx_renderer ${C1}GLX Version$SEP3${C2} $glx_version${CN}$direct_render_string" - graphics_data=$( create_print_line " " "$graphics_data" ) + graphics_data="${C1}GLX Renderer$SEP3${C2} $glx_renderer ${C1}GLX Version$SEP3${C2} $glx_version$direct_render_string" + graphics_data=$( create_print_line " " "$graphics_data${CN}" ) print_screen_output "$graphics_data" fi @@ -9684,7 +9695,7 @@ print_hard_disk_data() *) # using modulus here, if divisible by $divisor, print line, otherwise skip if [[ $(( $i % $divisor )) -eq 0 ]];then - hdd_data=$( create_print_line "$Line_Starter" "$hdd_model${CN}" ) + hdd_data=$( create_print_line "$Line_Starter" "$hdd_model" ) print_screen_output "$hdd_data" hdd_model='' Line_Starter=' ' @@ -9775,7 +9786,7 @@ print_info_data() # 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$SEP3${C2} $processes${CN} | ${C1}Uptime$SEP3${C2} $up_time${CN} | ${C1}Memory$SEP3${C2} $MEM${CN}" ) - info_data="${C1}Processes$SEP3${C2} $processes ${C1}Uptime$SEP3${C2} $up_time ${C1}Memory$SEP3${C2} $memory${CN} " + info_data="${C1}Processes$SEP3${C2} $processes ${C1}Uptime$SEP3${C2} $up_time ${C1}Memory$SEP3${C2} $memory " # this only triggers if no X data is present or if extra data switch is on if [[ $B_SHOW_DISPLAY_DATA != 'true' || $B_EXTRA_DATA == 'true' ]];then @@ -9821,12 +9832,12 @@ print_info_data() client_data="${C1}Client$SEP3${C2} $IRC_CLIENT$IRC_CLIENT_VERSION " fi # info_data="$info_data" - closing_data="$client_data${C1}$SCRIPT_NAME$SEP3${C2} $SCRIPT_VERSION_NUMBER$patch_version_number${CN}" + closing_data="$client_data${C1}$SCRIPT_NAME$SEP3${C2} $SCRIPT_VERSION_NUMBER$patch_version_number" # sometimes gcc is very long, and default runlevel can be long with systemd, so create a gcc-less line first if [[ $( calculate_line_length "$info_data$init_data$gcc_installed" ) -gt $COLS_INNER ]];then # info_data=$info_data - info_data=$( create_print_line "$line_starter" "$info_data" ) + info_data=$( create_print_line "$line_starter" "$info_data${CN}" ) print_screen_output "$info_data" info_data='' # closing_data='' @@ -9835,7 +9846,7 @@ print_info_data() fi if [[ $( calculate_line_length "$init_data$gcc_installed" ) -gt $COLS_INNER ]];then info_data=$init_data - info_data=$( create_print_line "$line_starter" "$info_data" ) + info_data=$( create_print_line "$line_starter" "$info_data${CN}" ) print_screen_output "$info_data" info_data='' init_data='' @@ -9844,7 +9855,7 @@ print_info_data() fi if [[ $( calculate_line_length "$info_data$init_data$gcc_installed$closing_data" ) -gt $COLS_INNER ]];then info_data=$info_data$init_data$gcc_installed - info_data=$( create_print_line "$line_starter" "$info_data" ) + info_data=$( create_print_line "$line_starter" "$info_data${CN}" ) print_screen_output "$info_data" info_data='' gcc_installed='' @@ -9854,7 +9865,7 @@ print_info_data() fi info_data="$info_data$init_data$gcc_installed$closing_data" - info_data=$( create_print_line "$line_starter" "$info_data" ) + info_data=$( create_print_line "$line_starter" "$info_data${CN}" ) if [[ $SCHEME -gt 0 ]];then info_data="$info_data ${NORMAL}" fi @@ -10005,31 +10016,31 @@ print_machine_data() fi IFS="$ORIGINAL_IFS" else - system_line="${C2}$sysDmiNull${CN}" + system_line="${C2}$sysDmiNull" fi # patch to dump all of above if dmidecode was data source and non root user if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' || ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' ]];then - system_line="${C2}${sysDmiError}dmidecode: you must be root to run dmidecode${CN}" + system_line="${C2}${sysDmiError}dmidecode: you must be root to run dmidecode" elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then - system_line="${C2}${sysDmiError}dmidecode: no machine data available${CN}" + system_line="${C2}${sysDmiError}dmidecode: no machine data available" fi mobo_line='' bios_line='' chassis_line='' fi - system_line=$( create_print_line "Machine:" "$system_line" ) + system_line=$( create_print_line "Machine:" "$system_line${CN}" ) print_screen_output "$system_line" if [[ -n $mobo_line ]];then - mobo_line=$( create_print_line " " "$mobo_line" ) + mobo_line=$( create_print_line " " "$mobo_line${CN}" ) print_screen_output "$mobo_line" fi if [[ -n $bios_line ]];then - bios_line=$( create_print_line " " "$bios_line" ) + bios_line=$( create_print_line " " "$bios_line${CN}" ) print_screen_output "$bios_line" fi if [[ -n $chassis_line ]];then - chassis_line=$( create_print_line " " "$chassis_line" ) + chassis_line=$( create_print_line " " "$chassis_line${CN}" ) print_screen_output "$chassis_line" fi @@ -10156,12 +10167,12 @@ print_networking_data() card_string="${C1}Card$card_id:${C2} ${a_network_working[0]} " card_data="$driver_data$port_data$pci_bus_id$chip_id" if [[ $( calculate_line_length "$card_string$card_data" ) -gt $COLS_INNER ]];then - network_data=$( create_print_line "$line_starter" "$card_string" ) + network_data=$( create_print_line "$line_starter" "$card_string${CN}" ) line_starter=' ' card_string='' print_screen_output "$network_data" fi - network_data=$( create_print_line "$line_starter" "$card_string$card_data" ) + network_data=$( create_print_line "$line_starter" "$card_string$card_data${CN}" ) line_starter=' ' print_screen_output "$network_data" if [[ $B_SHOW_ADVANCED_NETWORK == 'true' ]];then @@ -10170,7 +10181,7 @@ print_networking_data() done else network_data="${C1}Card:${C2} Failed to Detect Network Card! " - network_data=$( create_print_line "$line_starter" "$network_data" ) + network_data=$( create_print_line "$line_starter" "$network_data${CN}" ) print_screen_output "$network_data" fi if [[ $B_SHOW_IP == 'true' ]];then @@ -10221,7 +10232,7 @@ print_network_advanced_data() fi fi 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${CN}" ) print_screen_output "$network_data" eval $LOGFE @@ -10284,7 +10295,7 @@ print_networking_ip_data() if_string="$wan_ip_data$if_string${C1}IF:${C2} $if_id$if_ip_string$if_ipv6_string " wan_ip_data='' if [[ $( calculate_line_length "$if_string" ) -gt $line_max ]];then - full_string=$( create_print_line " " "$if_string" ) + full_string=$( create_print_line " " "$if_string${CN}" ) print_screen_output "$full_string" if_string='' fi @@ -10293,7 +10304,7 @@ print_networking_ip_data() # then print out anything not printed already if [[ -n $if_string ]];then - full_string=$( create_print_line " " "$if_string" ) + full_string=$( create_print_line " " "$if_string${CN}" ) print_screen_output "$full_string" fi eval $LOGFE @@ -10370,7 +10381,7 @@ print_optical_drive_data() drive_string="$drive_id ${C1}model$SEP3${C2} $vendor$rev ${C1}dev-links$SEP3${C2} $drive_links" fi drive_data="${C1}Optical${counter}:${C2} $drive_string" - drive_data=$( create_print_line "$Line_Starter" "$drive_data" ) + drive_data=$( create_print_line "$Line_Starter" "$drive_data${CN}" ) print_screen_output "$drive_data" Line_Starter=' ' # 5 - speed @@ -10441,7 +10452,7 @@ print_optical_drive_data() fi 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${CN}" ) print_screen_output "$drive_data" fi done @@ -10549,13 +10560,13 @@ print_partition_data() else line_starter=' ' fi - partition_data=$( create_print_line "$line_starter" "${a_partition_data[$i]}" ) + partition_data=$( create_print_line "$line_starter" "${a_partition_data[$i]}${CN}" ) print_screen_output "$partition_data" done eval $LOGFE } - +# legacy not used print_program_version() { local patch_version_number=$( get_patch_version_string ) @@ -10566,7 +10577,7 @@ print_program_version() # center pad: sed -e :a -e 's/^.\{1,80\}$/ & /;ta' #local line_max=$COLS_INNER #program_version="$( sed -e :a -e "s/^.\{1,$line_max\}$/ &/;ta" <<< $program_version )" # use to create padding if needed - # program_version=$( create_print_line "Version:" "$program_version" ) + # program_version=$( create_print_line "Version:" "$program_version${CN}" ) print_screen_output "$program_version" } @@ -10616,7 +10627,7 @@ print_ps_item() fi # appName, appPath, appStarterName, appStarterPath, cpu, mem, pid, vsz, user - ps_data=$( create_print_line "$line_starter" "$line_start_data" ) + ps_data=$( create_print_line "$line_starter" "$line_start_data${CN}" ) print_screen_output "$ps_data" for (( i=0; i < ${#A_PS_DATA[@]}; i++ )) @@ -10655,7 +10666,7 @@ print_ps_item() (( line_counter++ )) count_nu="${C1}$line_counter:${C2}" 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${CN}" ) print_screen_output "$ps_data" done @@ -10946,7 +10957,7 @@ print_raid_data() fi if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count != '' ]];then if [[ $i == 0 ]];then - raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count]}" ) + raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count]}${CN}" ) print_screen_output "$raid_data" line_starter=' ' fi @@ -10955,7 +10966,7 @@ print_raid_data() print_screen_output "$raid_data" if [[ $B_EXTRA_EXTRA_DATA == 'true' && $array_count_unused != '' ]];then if [[ $i == $(( array_count_unused - 2 )) ]];then - raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count_unused]}" ) + raid_data=$( create_print_line "$line_starter" "${a_raid_data[array_count_unused]}${CN}" ) print_screen_output "$raid_data" fi fi @@ -11005,9 +11016,9 @@ print_repo_data() fi # first line print Repos: if [[ $repo_count -eq 1 ]];then - repo_full=$( create_print_line "Repos:" "$repo_full" ) + repo_full=$( create_print_line "Repos:" "$repo_full${CN}" ) else - repo_full=$( create_print_line " " "$repo_full" ) + repo_full=$( create_print_line " " "$repo_full${CN}" ) fi print_screen_output "$repo_full" # this prints the content of the file as well as the file name @@ -11152,16 +11163,16 @@ print_sensors_data() # unless -s used explicitly. So for -F type output won't show unless valid or -! 1 used if [[ $b_is_error != 'true' || $B_SHOW_SENSORS == 'true' || $B_TESTING_1 == 'true' ]];then temp_data="$cpu_temp$mobo_temp$psu_temp$gpu_temp" - temp_data=$( create_print_line "Sensors:" "$temp_data" ) + temp_data=$( create_print_line "Sensors:" "$temp_data${CN}" ) print_screen_output "$temp_data" # don't print second or subsequent lines if error data fan_data="$cpu_fan$mobo_fan$ps_fan$sys_fans" if [[ $b_is_error != 'true' && -n $fan_data ]];then - fan_data=$( create_print_line " " "$fan_data" ) + fan_data=$( create_print_line " " "$fan_data${CN}" ) print_screen_output "$fan_data" # and then second wrapped fan line if needed if [[ -n $sys_fans2 ]];then - fan_data2=$( create_print_line " " "$sys_fans2" ) + fan_data2=$( create_print_line " " "$sys_fans2${CN}" ) print_screen_output "$fan_data2" fi fi @@ -11247,13 +11258,13 @@ print_system_data() distro_string="${C1}Distro$SEP3${C2} $distro " if [[ $( calculate_line_length "$host_kernel_string$de_string" ) -gt $COLS_INNER ]];then - system_data=$( create_print_line "$line_starter" "$host_kernel_string" ) + system_data=$( create_print_line "$line_starter" "$host_kernel_string${CN}" ) print_screen_output "$system_data" host_kernel_string='' line_starter=' ' fi if [[ $( calculate_line_length "$host_kernel_string$de_string$distro_string" ) -gt $COLS_INNER ]];then - system_data=$( create_print_line "$line_starter" "$host_kernel_string$de_string" ) + system_data=$( create_print_line "$line_starter" "$host_kernel_string$de_string${CN}" ) print_screen_output "$system_data" host_kernel_string='' de_string='' @@ -11262,7 +11273,7 @@ print_system_data() system_data="$host_kernel_string$de_string$distro_string" if [[ -n $system_data ]];then system_data="$host_kernel_string$de_string$distro_string" - system_data=$( create_print_line "$line_starter" "$system_data" ) + system_data=$( create_print_line "$line_starter" "$system_data${CN}" ) print_screen_output "$system_data" fi @@ -11326,11 +11337,11 @@ print_unmounted_partition_data() if [[ $BSD_TYPE == 'bsd' ]];then full_string=$bsd_unsupported fi - unmounted_data=$( create_print_line "$line_starter" "$full_string" ) + unmounted_data=$( create_print_line "$line_starter" "$full_string${CN}" ) print_screen_output "$unmounted_data" done else - unmounted_data=$( create_print_line "Unmounted:" "No unmounted partitions detected" ) + unmounted_data=$( create_print_line "Unmounted:" "No unmounted partitions detected${CN}" ) print_screen_output "$unmounted_data" fi @@ -11404,11 +11415,11 @@ print_weather_data() if [[ $B_EXTRA_DATA != 'true' ]];then weather_data="$weather_string $time_string" - weather_data=$( create_print_line "Weather:" "$weather_data" ) + weather_data=$( create_print_line "Weather:" "$weather_data${CN}" ) print_screen_output "$weather_data" else weather_data="$weather_string" - weather_data=$( create_print_line "Weather:" "$weather_data" ) + weather_data=$( create_print_line "Weather:" "$weather_data${CN}" ) print_screen_output "$weather_data" if [[ $B_EXTRA_EXTRA_EXTRA_DATA == 'true' ]];then if [[ -n ${a_weather[8]} ]];then @@ -11444,10 +11455,10 @@ print_weather_data() fi # the last three are oftenblank if [[ -z "$heat_index$wind_chill$dew_point" ]];then - weather_data=$( create_print_line " " "$pressure$location_string" ) + weather_data=$( create_print_line " " "$pressure$location_string${CN}" ) print_screen_output "$weather_data" else - weather_data=$( create_print_line " " "$pressure$heat_index$wind_chill$dew_point" ) + weather_data=$( create_print_line " " "$pressure$heat_index$wind_chill$dew_point${CN}" ) print_screen_output "$weather_data" if [[ $B_OUTPUT_FILTER != 'true' ]];then weather_data=$( create_print_line " " "$location_string" ) @@ -11455,13 +11466,13 @@ print_weather_data() fi fi if [[ -n $time_string$observation_time ]];then - weather_data=$( create_print_line " " "$time_string$observation_time" ) + weather_data=$( create_print_line " " "$time_string$observation_time${CN}" ) print_screen_output "$weather_data" fi else if [[ -n $pressure$time_string ]];then weather_data="$pressure$time_string" - weather_data=$( create_print_line " " "$weather_data" ) + weather_data=$( create_print_line " " "$weather_data${CN}" ) print_screen_output "$weather_data" fi fi @@ -11469,7 +11480,7 @@ print_weather_data() else weather_data=$( create_print_line "Weather:" "Weather data failure: $(date)" ) print_screen_output "$weather_data" - weather_data=$( create_print_line " " "${A_WEATHER_DATA}" ) + weather_data=$( create_print_line " " "${A_WEATHER_DATA}${CN}" ) print_screen_output "$weather_data" fi eval $LOGFE