How to display Good Morning in Backtrack

June 12, 2013

How to display Good Morning in Backtrack

Write a script, which displays Good Morning if hour is less than 12, Good Afternoon if hour is less than5 p.m. and Good Evening if hour is greater than 5 p.m.

Code

#!/bin/bash
clear
hour=$(date +%H)
echo”-----------------------------------------”
echo”the yet time now”
if [ "$hour" -lt 12 ]; then
echo "Good Morning"
elif [ "$hour" -lt 17 ]; then
echo "Good Afternoon"
elif [ "$hour" -gt 17 ]; then
echo "Good Morning"
fi

Screen Shot

How to display Good Morning in Backtrack

You Might Also Like

0 comments

Popular Posts

Like us on Facebook

Flickr Images