If possible I would to try and stay in sed, as I am trying to learn it now. I want to define 4 different variables for 4 different time slots in a bash script but don't know where to begin. I would like to have the variables as follows:
$Shift1 = 00:00:00 - 05:59:59
$Shift2 = 06:00:00 - 11:59:59
$Shift3 = 12:00:00 - 17:59:59
$Shift4 = 18:00:00 - 23:59:50
Eventually I want to use the variables based on the current time. For example, if the current time is 17:05:26 variable to be used is $Shift3 and echo the variable to a csv file row along with a date and time. Any suggestions on where I could begin?
I have been reading the sed manual for almost 2 hours and can't figure it out. What I am hoping for more than anything is something that is simple enough and in a HUMAN language that could easily be edited. For example I worry that a few months down the road the time slot might change and shift1 might no longer be starting at midnight, so I would like to be able to understand the syntax enough to edit the hours as needed in the future.