[Remind-Fans] How to query the next 24 hours?

Allan Wind allan_wind at lifeintegrity.com
Tue May 25 18:51:13 EDT 2021


On 2021-05-25 15:32:22, Tim Chase wrote:
>On 2021-05-25 10:18, Allan Wind wrote:
>> Query two days and having to manually filter out 50% is not great
>> for me.
>
>To be fair, this is costs next to nothing.  I have
>
>  $ rem -qn | wc -l
>  2123

You might have misunderstood what I was trying to say.  Dianna's 
suggestion was to use -qt1 so:

cat <<EOF | remind -t1 - $(date -d 'now 00:00' +"%F %H:%M") | tail +3 | grep -v '^$'
REM 2021-5-25 MSG today
REM 2021-5-25 AT 12:00 MSG today at noon
REM 2021-5-25 AT 21:00 MSG today at 21:00
REM 2021-5-26 MSG tomorrow
REM 2021-5-26 AT 12:00 MSG tomorrow at noon
REM 2021-5-26 AT 21:00 MSG tomorrow at 21:00
EOF
today
today at noon
today at 21:00
tomorrow
tomorrow at noon
tomorrow at 21:00

With "not great" it means that Allan's brain which runs at ~2 HZ 
on a good day have to figure out that today, today at noon, and 
tomorrow at 21:00 can be filtered out.  This probably means I have 
to update all events with a "%a %3" prefix (duplicate time input, 
and losing error handling) so it becomes:

today at 00:00 today
today at 12:00 today at noon
today at 21:00 today at 21:00
tomorrow at 00:00 tomorrow
tomorrow at 12:00 tomorrow at noon
tomorrow at 21:00 tomorrow at 21:00

which can be filtered with egrep:

... | egrep -v '^$|^today at [01]|^tomorrow at 2'
today at 21:00 today at 21:00
tomorrow at 00:00 tomorrow
tomorrow at 12:00 at noon

Or alternatively, mangle the prefix and pass it to date, so
I can get now + 24 hours.

Btw, I have to use 00:00 as the as the time input to remind as %3 
returns the it rather than 00:00 if a rule doesn't have an AT clause.


More information about the Remind-fans mailing list