[sf-lug] calculating meeting dates ... Re: SF-LUG meeting notes for Sunday June 2, 2019

Michael Paoli Michael.Paoli at cal.berkeley.edu
Mon Jun 3 21:24:32 PDT 2019


$ (TZ=US/Pacific export TZ; { upcoming_meetings 1st Su | head -n 1
> upcoming_meetings 3rd M | head -n 1; } | sort | head -n 1)
2019-06-17
$
Now, one could fiddle, perhaps relatively artificially, with TZ
(timezone) setting and/or faketime, to more precisely control that,
e.g. when do you want it to go from current to "next" on "day of" ...
at the start of the meeting?  Or at its (scheduled) end?

Want next, oh, say 10 upcoming meeting dates?
$ (n=10; TZ=US/Pacific export TZ; { upcoming_meetings 1st Su |
> head -n "$n"; upcoming_meetings 3rd M | head -n "$n"; } | sort |
> head -n "$n")
2019-06-17
2019-07-07
2019-07-15
2019-08-04
2019-08-19
2019-09-01
2019-09-16
2019-10-06
2019-10-21
2019-11-03
$

Anyway, ... upcoming meetings ... 'bit 'o Perl code I wrote (I got tired of
otherwise figuring out all the various (typically [L]UG) meeting dates.

Or if you're lookin' to mark your SF-LUG calendars for the
remainder of the year:
$ echo $({ upcoming_meetings 1st Su | sed -ne '/^2020-/q;p'
> upcoming_meetings 3rd M |  sed -ne '/^2020-/q;p'; }) |
> sort | fold -s -w 72 | sed -e 's/ $//'
2019-07-07 2019-08-04 2019-09-01 2019-10-06 2019-11-03 2019-12-01
2019-06-17 2019-07-15 2019-08-19 2019-09-16 2019-10-21 2019-11-18
2019-12-16
$

> From: "Alex Kleider" <akleider at sonic.net>
> Subject: Re: [sf-lug] SF-LUG meeting notes for Sunday June 2, 2019
> Date: Mon, 03 Jun 2019 20:38:22 -0700

> On 2019-06-03 19:31, Rick Moen wrote:
>> Quoting aaronco36 (aaronco36 at SDF.ORG):
>>
>>> While I'm sure this snippet was just a test to see who is reading
>>> this carefully, it turns out that the terminal command 'cal -B1 -1'
>>> reveals that you (Bobbie) probably meant to write Monday _June_ 17
>>> and _June_ 13 instead of the _May_ dates that you wrote above. See
>>> 'man 1 cal' for further information about the nifty 'cal' command,
>>> whether from SF, from the Peninsula, or from the wider East Bay area
>>> surrounding the actual UC Berkeley campus...  LOL! ;->
>>
>> /usr/bin/cal is definitely my kung-fu!  More at:
>> http://linuxmafia.com/faq/Linux_PR/newlug.html  ('cal' is recommended
>> strongly in item #12.)
>
> I tried your script:
>
> #!/bin/sh
> echo "Type the future date in ISO 8601 (YYYY-MM-DD) format."
> read futuredate
> echo $futuredate | tr -s '-' ' ' | awk '{dt=mktime($0 "  
> 00-00-00")-systime(); print int(dt/86400+1) " days";}'
>
> ... with the following result:
>
> Type the future date in ISO 8601 (YYYY-MM-DD) format.
> 2019-07-01
> awk: line 2: function systime never defined
> awk: line 2: function mktime never defined
>
> Your system appears to have 'features' that my (Ubuntu 18-04) lacks.
>
> ;-(:wq




More information about the sf-lug mailing list