Last active
July 19, 2018 17:43
-
-
Save sbilstein/25fd5b846ae30c006d6e45b58acb1c9c to your computer and use it in GitHub Desktop.
Get an emoji for the time of day!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function get_time | |
{ | |
local hour="`date +%H`" | |
local emoji="a" | |
if [ $hour -lt 10 -a $hour -gt 6 ]; then | |
emoji="🌅" | |
elif [ $hour -lt 15 ]; then | |
emoji="☀️" | |
elif [ $hour -lt 20 ]; then | |
emoji="🌇" | |
else | |
emoji="🌓" | |
fi | |
current_time="`date +%H:%M:%S`"; | |
echo "$current_time $emoji"; | |
} | |
get_time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment