Wednesday, 12 June 2013

How to display Good Morning in Backtrack

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

No comments:

Post a Comment