I am using a script to compare time but getting the error, Quarterly_File.sh: line 139: [[: 0148: value too great for base (error token is "0142"). Is there any way I could change my inputs in time (hour) format and compare it with other time? My inputs are as follows.
startTime=00:45
endTime=01:30
fileTime=01:42
I am simply comparing them by removing : between them, like below.
if (0142 -ge 0045 && 0142 -lt 0130)
then
// my logic
fi
Note that time range could be anything within a one-hour range.
Examples
0000 0045,
0030 0130,
2345 0014 (of next day)