开发者

Using `remind` to get next weeks schedule

开发者 https://www.devze.com 2023-04-01 01:16 出处:网络
I have just started using the remind tool on GNU/Linux: remind man page. I have the following bash functions using remind to get todays, tomorrows and this weeks reminders

I have just started using the remind tool on GNU/Linux: remind man page. I have the following bash functions using remind to get todays, tomorrows and this weeks reminders

today() {
  remind $SCHEDULE
}
tomorrow() {
  tomorrow=`date --date=tomorrow +"%d %b %Y"`
  remind $SCHEDULE $tomorrow
}
thisweek() {
  remind -mc+ $SCHEDULE
}

Here $SCHEDULE is the path to my reminder file i use for all appointments, anniversaries etc. today and tomorrow simply uses remind to list the reminders for a single day in list form. In thisweek, remind -mc generates a table for the present week with all reminders for the involved dates. I would like to have a nextweek function that generates the开发者_JAVA技巧 table for the next week ie. the days Monday through Sunday where Monday is the first Monday after todays date. I cant figure out if this is doable using remind.


I didn't see any options for remind to do it directly, so awk to the rescue: output 2 week's worth, and remove the first week with awk.

remind -mc+2 "$SCHEDULE" | awk '/^\+/ {n++} n!=2'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号