ansiweather

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

commit 3fe7ecec197c658b2fb6b5362bcb83905451fc44
parent a327e768d90b50845980821ff0ebf78ef5920042
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Sat,  2 Nov 2013 07:30:07 -0700

Merge pull request #33 from bodjkin/os_check

Added OS check to use correct options for date with Linux (Closes #32)
Diffstat:
Mansiweather | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ansiweather b/ansiweather @@ -143,7 +143,12 @@ weather=$($fetch_cmd "http://api.openweathermap.org/data/2.5/$api_cmd?q=$locatio ###[ Process Weather data ]#################################################### function epoch_to_date { - ret=$(date -j -r $1 +"%a %b %d") + unamestr=$(uname) + if [[ "$unamestr" == 'Linux' ]]; then + ret=$(date -d @$1 +"%a %b %d") + else + ret=$(date -j -r $1 +"%a %b %d") + fi echo $ret }