SHELL PROGRAM
Program for displays the message Good Morning/ Good Afternoon/ good evening depending on the time it get executed |shell Program|
clear
hours=`date|cut -c12-13`
if [ $hours -le 12 ]
then
echo "good morning"
else
if [ $hours -le 16 ]
then
echo "good afternoon"
elif [ $hours -le 20 ]
then
echo "good evening"
else
echo "good night"
fi
fi
hours=`date|cut -c12-13`
if [ $hours -le 12 ]
then
echo "good morning"
else
if [ $hours -le 16 ]
then
echo "good afternoon"
elif [ $hours -le 20 ]
then
echo "good evening"
else
echo "good night"
fi
fi
Post a Comment
0 Comments