diff --git a/inxi b/inxi index 78c484c..7240133 100755 --- a/inxi +++ b/inxi @@ -2874,17 +2874,19 @@ get_de_version() ;; esac - version=$( gawk ' - BEGIN { - IGNORECASE=1 - } - /'$2'/ { - # sample: dwm-5.8.2, ©.. etc, why no space? who knows. Also get rid of v in number string - # xfce, and other, output has , in it, so dump all commas - gsub(/(,|dwm-|wmii-|v|V)/, "",$'$3') - print $'$3' - exit # quit after first match prints - }' <<< "$version_data" ) + if [[ -n $version_data ]];then + version=$( gawk ' + BEGIN { + IGNORECASE=1 + } + /'$2'/ { + # sample: dwm-5.8.2, ©.. etc, why no space? who knows. Also get rid of v in number string + # xfce, and other, output has , in it, so dump all commas + gsub(/(,|dwm-|wmii-|v|V)/, "",$'$3') + print $'$3' + exit # quit after first match prints + }' <<< "$version_data" ) + fi echo $version }