ansiweather

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

commit 36a2e47310891b66b9ef8d1f86096143ca59fe05
parent 40f07cc5f6e862f32c0ab970b61c32ca1b16c000
Author: L Nix <lornix@lornix.com>
Date:   Mon, 21 Sep 2015 00:17:02 -0700

Force bc to return ints, no decimals for 'shift'

The result from bc's calculation will return verious
decimal places due to bc's default scale (20).

sh's 'shift' doesn't like decimals.

Force scale=0 to cause bc to return integers.

Diffstat:
Mansiweather | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ansiweather b/ansiweather @@ -261,7 +261,7 @@ set -- N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW if [ "$forecast" = 0 ] then - shift "$(echo "($azimuth + 11.25)/22.5 % 16" | bc)" + shift "$(echo "scale=0; ($azimuth + 11.25)/22.5 % 16" | bc)" direction=$1 fi