Prevent globbing and word splitting

This commit is contained in:
Riyyi
2019-12-30 23:03:21 +01:00
parent dd8c4ac631
commit 9e1686fd99
2 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -2,8 +2,8 @@
BAT_INFO=${BLOCK_INSTANCE:-"$(acpi -b | grep ': [^Unknown]')"}
CAPACITY=$(echo $BAT_INFO | awk '{ print int($4) }')
TIME="$(echo $BAT_INFO | awk '{ print substr($5, 0, length($5) - 3) }')"
CAPACITY=$(echo "$BAT_INFO" | awk '{ print int($4) }')
TIME="$(echo "$BAT_INFO" | awk '{ print substr($5, 0, length($5) - 3) }')"
CHARACTER=":"
if [ "$TIME" != "" ] && [ "${TIME#*$CHARACTER}" != "$TIME" ]; then
@@ -13,7 +13,7 @@ else
fi
COLOR="-"
if [ "$(echo $BAT_INFO | awk '{ print $6 }')" = "remaining" ]; then
if [ "$(echo "$BAT_INFO" | awk '{ print $6 }')" = "remaining" ]; then
if [ "$CAPACITY" -ge "80" ]; then
ICON=""
elif [ "$CAPACITY" -ge "60" ]; then