barmylad
June 11th, 2009, 05:11 PM
Hello,
I'm just learning bash scripting and need some help.
What i want to do is give a message at different times of the day, say good morning when between 06:00 and 11:59, good afternoon when its between 12:00 and 18:00 and finally good evening when its between 18:00 and 23:59.
like i said I'm just a beginner so be gentle :p
here is what i have so far:
date > time1
awk '{print $4}' time1
this gives me the time but after that I'm stuck, I have tried a few 'if' statements but i cant get it to work e.g: if (this) then echo "that" sort of stuff but no luck :(
Any help would be much appreciated.
Thanks.
Barmy.
I'm just learning bash scripting and need some help.
What i want to do is give a message at different times of the day, say good morning when between 06:00 and 11:59, good afternoon when its between 12:00 and 18:00 and finally good evening when its between 18:00 and 23:59.
like i said I'm just a beginner so be gentle :p
here is what i have so far:
date > time1
awk '{print $4}' time1
this gives me the time but after that I'm stuck, I have tried a few 'if' statements but i cant get it to work e.g: if (this) then echo "that" sort of stuff but no luck :(
Any help would be much appreciated.
Thanks.
Barmy.