Custom Search

Friday 20 April 2012

Write a Linux shell script to wish good morning, Good afternoon and Good night as per current system time, Unix program to use current system time


Write a Linux shell script to wish good morning, Good afternoon and Good night as per current system time, Unix program to use current system time


Program
clear
date>dt
tm= 'cut-c 12-13 dt'
echo $tm


if [ $tm-lt 12]
then
  echo "Good Morning!!"
elif [$tm-gt12-a $tm-lt16]
then
  echo "Good Afternoon!!"
elif [$tm-gt16-a $tm-lt20]
then
  echo "Good Evening!!"
else
 echo "Good Night!!"
fi


Output


Good Afternoon
<<< Previous  ||  Current  ||  Next >>>  

1 comment:

Laptops