summaryrefslogtreecommitdiff
path: root/ult/ult_7/clause.sh
blob: 23017f264478245aed26ffd5ad72aa3163605600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# Script to greet the user according to time of day
hour=`date | cut -c12-13`
now=`date +"%A, %d of %B, %Y (%r)"`
if [ $hour -lt 12 ]
then
  mess="Good Morning $LOGNAME, Have a nice day!"
fi

if [ $hour -gt 12 -a $hour -le 16 ]
then
  mess="Good Afternoon $LOGNAME"
fi

if [ $hour -gt 16 -a $hour -le 18 ]
then
  mess="Good Evening $LOGNAME"
fi
echo -e "$mess\nIt is $now"