Comparing Time

I want to write a shell script which will run when a new terminal is opened and will display Good Morning or Good Evening depending on the current time?

Check the man-page for date. Example (on Linux, others might not know the -d option or the %l format):

> LANG=C date -d'00:00:00' +'%l %p'
12 AM
> LANG=C date -d'12:00:00' +'%l %p'
12 PM
case $(date +%p) in
     AM) echo Good Morning ;;
     PM) echo Good Afternoon ;;
     *) echo Not so good ;;
esac