Skip to content

Instantly share code, notes, and snippets.

@CoderCowMoo
Created April 12, 2022 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CoderCowMoo/75734cc4fd9b30a9de428bdb68498e0b to your computer and use it in GitHub Desktop.
Save CoderCowMoo/75734cc4fd9b30a9de428bdb68498e0b to your computer and use it in GitHub Desktop.
A bash script to greet you depending on the time of day with your name included in it. Uses cowsay to display messages
# times to put in were gotten from Tabliss extension with messages @
# https://github.com/joelshepherd/tabliss/blob/main/src/plugins/widgets/greeting/messages.ts
h=`date +%H`
PREFNAME="Moo"
if [ $h -ge 0 -a $h -le 2 ]; then
echo Sleep well, $PREFNAME | cowsay
elif [ $h -ge 3 -a $h -le 5 ]; then
echo Rise and shine, $PREFNAME | cowsay
elif [ $h -ge 6 -a $h -le 9 ]; then
echo Good morning, $PREFNAME | cowsay
elif [ $h -ge 10 -a $h -le 13 ]; then
echo Hello, $PREFNAME | cowsay
elif [ $h -ge 14 -a $h -le 17 ]; then
echo Good afternoon, $PREFNAME | cowsay
elif [ $h -ge 18 -a $h -le 21 ]; then
echo Good evening, $PREFNAME | cowsay
elif [ $h -ge 22 -a $h -le 23 ]; then
echo Good night, $PREFNAME | cowsay
else
echo Not sure what time it is $PREFNAME but it is nice to see you | cowsay
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment