ansiweather

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

commit 52c1a15a33471209cff67bfed3fad3c77817fb94
parent 3cfaff01fed02391eed65a8df2b3a130dc8f9dfb
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Thu, 30 Jul 2015 22:04:41 +0200

Using sh instead of bash, commenting problematic code (array related stuff) for now

Diffstat:
Mansiweather | 46+++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/ansiweather b/ansiweather @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################### # # @@ -6,7 +6,7 @@ # https://github.com/fcambus/ansiweather # # # # Created: 2013/08/29 # -# Last Updated: 2015/05/09 # +# Last Updated: 2015/07/30 # # # # AnsiWeather is released under the BSD 3-Clause license. # # See LICENSE file for details. # @@ -190,25 +190,25 @@ then city=$(echo $weather | jq -r '.city.name') flength=$(echo $weather | jq '.list | length') forecast=$([[ $forecast -gt $flength ]] && echo $flength || echo $forecast) - days=() - dates=() - lows=() - highs=() - humidity=() - pressure=() - sky=() +# days=() +# dates=() +# lows=() +# highs=() +# humidity=() +# pressure=() +# sky=() i=0 while [ $i -lt $forecast ] do - days+=("$(echo $weather | jq ".list[$i]")") - dates+=("$(epoch_to_date $(echo ${days[$i]} | jq -r '.dt'))") - lows+=("$(printf "%0.0f" $(echo ${days[$i]} | jq -r '.temp.min'))") - highs+=("$(printf "%0.0f" $(echo ${days[$i]} | jq -r '.temp.max'))") - humidity+=("$(echo ${days[$i]} | jq -r '.humidity')") - pressure+=("$(echo ${days[$i]} | jq -r '.pressure')") - sky+=("$(echo ${days[$i]} | jq -r '.weather[0].main')") - +# days+=("$(echo $weather | jq ".list[$i]")") +# dates+=("$(epoch_to_date $(echo ${days[$i]} | jq -r '.dt'))") +# lows+=("$(printf "%0.0f" $(echo ${days[$i]} | jq -r '.temp.min'))") +# highs+=("$(printf "%0.0f" $(echo ${days[$i]} | jq -r '.temp.max'))") +# humidity+=("$(echo ${days[$i]} | jq -r '.humidity')") +# pressure+=("$(echo ${days[$i]} | jq -r '.pressure')") +# sky+=("$(echo ${days[$i]} | jq -r '.weather[0].main')") +# i=$(($i + 1)) done else @@ -227,13 +227,13 @@ fi ###[ Process Wind data ]####################################################### -declare -a directions -directions=(N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW) +#declare -a directions +#directions=(N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW) -if [ $forecast = 0 ] -then - direction=${directions[$(echo "($azimuth + 11.25)/22.5 % 16" | bc)]} -fi +#if [ $forecast = 0 ] +#then +# direction=${directions[$(echo "($azimuth + 11.25)/22.5 % 16" | bc)]} +#fi