mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
added in a null case check
This commit is contained in:
parent
8561e00ca9
commit
9df881c11f
24
inxi
24
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue