~johanvandegriff/unix-shell-programming-revised-edition-programs

unix-shell-programming-revised-edition-programs/greetings.sh -rw-r--r-- 214 bytes
fc214385Johan Vandegriff added other old scripts, some newer ones too 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

#
# Program to print a greeting
#

echo

hour=`date +%H`


case $hour in
  0? | 1[01] )   echo "Good morning";;
      1[2-7] )   echo "Good afternoon";;
           * )   echo "Good evening";;
esac

echo