[Users] Search for messages between timestamps

Removed GDPR removed-gdpr at example.com
Wed Aug 22 17:09:06 CEST 2018


On Wed, 22 Aug 2018 11:22:10 +0100 Brian Morrison
wrote:

> There's a tool on Fedora called pdd, it can
> calculate date ranges etc. You may be able to create
> a script file that uses it and then call that as an
> action.

I couldn't find this tool on openSUSE but I wrote a
simple bash script:

----------
#!/bin/bash

current=$(date -d "${1}" +%s)
start=$(date -d "${2}" +%s)
end=$(date -d "${3}" +%s)

if [[ $current -ge $start && $current -le $end ]]; then
    exit 0
fi
exit 1
----------

Then I used it in extended search:

test "$HOME/bin/is-date-in-range %d 2018-08-01 2018-08-10"

There are 2 issues I notice:

1. Messages from 2018-08-10 are not shown (there are 3
of them in the folder)

2. It is quite slow. I am testing on a local (MH)
folder with 491 messages (4.04Mb) and it takes 25
seconds show the result consisting of 86 messages
(639Kb).

Any idea why?

--
George



More information about the Users mailing list