Saturday, January 11, 2014

PROGRAM FOR  USAGE OF DATE AND TIME

n=`date +%H`
i=`date +%T`
echo $i
if test $n -lt 12
then
echo good morning
elif test $n -gt 12 -a $n -lt 16
then
echo good afternoon
elif test $n -gt 16 -a $n -lt 18
then
echo good evening
else
echo good night
fi
~
~
~
~
~
~
~
~
~
~
~
~
~
OUTPUT
"wishdate" 15L, 214C written
[staff@linuxserver staff]$ sh wishdate
10:03:19
good morning
[staff@linuxserver staff]$
























No comments:

Post a Comment