zshrc: little fixes
authorMoviuro <moviuro+grml@gmail.com>
Tue, 23 Sep 2014 06:04:16 +0000 (08:04 +0200)
committerFrank Terbeck <ft@grml.org>
Tue, 23 Sep 2014 12:24:15 +0000 (14:24 +0200)
Missing local variable
Changed a '! -z' to '-n' test

etc/zsh/zshrc

index a164fb8..3deb1e0 100644 (file)
@@ -1697,10 +1697,10 @@ fi
 
 batteryopenbsd(){
 GRML_BATTERY_LEVEL=''
-local batfull batwarn batnow num
+local bat batfull batwarn batnow num
 for num in 0 1 ; do
     bat=$(sysctl -n hw.sensors.acpibat${num})
-    if [[ ! -z $bat ]]; then
+    if [[ -n $bat ]]; then
         batfull=${"$(sysctl -n hw.sensors.acpibat${num}.amphour0)"%% *}
         batwarn=${"$(sysctl -n hw.sensors.acpibat${num}.amphour1)"%% *}
         batnow=${"$(sysctl -n hw.sensors.acpibat${num}.amphour3)"%% *}