From d292a512193c27af7c87ecf899ec1ee9f5ecbf42 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 8 Jan 2015 21:57:12 +0900 Subject: [PATCH] Fix bug in __my_ps1_bttry --- shrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shrc b/shrc index b0b27b9..c6fc38f 100755 --- a/shrc +++ b/shrc @@ -1071,7 +1071,7 @@ __my_battery_status(){ ___st=$(cat $___dir/status) ___full=$(cat $___dir/charge_full) ___now=$(cat $___dir/charge_now) - ___rate=$(expr $now \* 100 / $full) + ___rate=$(expr "$___now" \* 100 / "$___full") printf "$1" "${___st}:${___rate}%" fi } @@ -1131,7 +1131,7 @@ __my_ps1_bttry(){ then test -f $___bst && ___bstr="$(cat $___bst)" test -n "$___bstr" && ! echo $___bstr | grep 100 >/dev/null 2>&1 && \ - echo "[Battery:$___bstr]" + echo "[Battery:${___bstr}]" __my_battery_status %s >$___bst & fi }