On Fri, Jul 29, 2011 at 10:02:03AM -0400, David F. Skoll wrote:
On Thu, 28 Jul 2011 22:31:53 -0600
Dave Parker <[email protected]> wrote:

Is there a way to get a similar report for the next fourteen days
starting today?

Unfortunately not.  You'd have to ask for three weeks' worth of
output and then filter out anything earlier than today.

Here's a bash function I use to do something very similar. It relies on the fact that when dates are in YYYYMMDD format, comparing the dates as integers has the same result as comparing them chronologically. It does use some bash-specific variable substring enhancements to avoid running processes to get the remind output in YYYYMMDD format.

remind_after_today() {
  local today=$(date +%Y%m%d)

  while read date x x x x rest; do
    if [ "${date:0:4}${date:5:2}${date:8:2}" -ge "$today" ]; then
      echo "$date $rest";
    fi
  done
}

Place in the script that calls remind (or your .bashrc if you want to use it from the command line). Use like "rem -s3 | remind_after_today".

--
Ed Blackman

Attachment: signature.txt
Description: Digital signature

_______________________________________________
Remind-fans mailing list
[email protected]
http://lists.roaringpenguin.com/cgi-bin/mailman/listinfo/remind-fans
Remind is at http://www.roaringpenguin.com/products/remind

Reply via email to