I have some data spread over time intervals, and I want to take some of those data within the time intervals. For example, I have data at times within 1..9, 11..19, etc., and I want to take data within 1-2, then 11-12, etc.
This will be part of a more complex bash
script, in which I want to include this condition, with a if
cycle, to isolate the times where I can catch the data.
I was thinking something like:
if (( $t_initial & $t_final )) in (begin1, fin1) or in (begin2, fin2) ...
where t_initial
and t_final
are calculated separately, by the script itself.
I can not write this condition in bash
syntax. I found some other solutions, but they seem extremely long and inconvenient, so I am here to ask simpler and more readable solutions.
t_initial=1, t_final=3, begin1=2,fin1=4
? Is that a match or not? – LatinSuD Jun 27 at 9:27begin
andfin
are intended to be the extreme times of a given interval. if the times are not within the intervals, then the condition is not satisfied. – Py-ser Jun 27 at 9:29