ansiweather

Weather in terminal, with ANSI colors and Unicode symbols
Log | Files | Refs | README | LICENSE

commit c9b16d9d61dc3a3eb78951ebb8045d3ecbaec7ad
parent f3d484ed4122668649ff75edc65a6e27967887ca
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Sun, 16 Aug 2015 15:43:59 +0200

Quoting strings before piping them to jq

Diffstat:
Mansiweather | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ansiweather b/ansiweather @@ -188,7 +188,7 @@ epoch_to_date() { if [ $forecast != 0 ] then city=$(echo "$weather" | jq -r '.city.name') - flength=$(echo $weather | jq '.list | length') + flength=$(echo "$weather" | jq '.list | length') forecast=$([ $forecast -gt $flength ] && echo $flength || echo $forecast) else city=$(echo "$weather" | jq -r '.name') @@ -331,7 +331,7 @@ then i=0 while [ $i -lt $forecast ] do - day=$(echo $weather | jq ".list[$i]") + day=$(echo "$weather" | jq ".list[$i]") date=$(epoch_to_date $(echo $day | jq -r '.dt')) low=$(printf "%0.0f" $(echo $day | jq -r '.temp.min')) high=$(printf "%0.0f" $(echo $day | jq -r '.temp.max'))