Re: Weekday abbreviations in output of cal(1)

2020-07-02 Thread Valery Ushakov
Valery Ushakov wrote: > Wolfgang Solfrank wrote: > >>> "first $WEEKDAY of next month". I am at a loss how to do this with >>> NetBSD's date(1). >> >> Thanks for the explanation. >> >> Ok, let's try with a double invocation: >> >> $ date -d "$(date -d '+1 month' '+%m/01/%C%y') sat" >> Sat

Re: Weekday abbreviations in output of cal(1)

2020-07-02 Thread Martin Neitzel
Hi Wolfgang, >> "first $WEEKDAY of next month". I am at a loss how to do this > $ date -d "$(date -d '+1 month' '+%m/01/%C%y') sat" > Sat Aug 1 00:00:00 CEST 2020 Nifty -- I would probably never have solved this. Thanks! Martin Neitzel

Re: Weekday abbreviations in output of cal(1)

2020-07-02 Thread Wolfgang Solfrank
Hi, Because yesterday was unsuitable to check for the ambiguity how the second "1" in that expression is actually parsed. Is it parsed as in: (+1 month 1) thu as in "go next month, its 1st, forward to Thursday", or is it: +1 month (1 thu) as in "go next month (same day as

Re: Weekday abbreviations in output of cal(1)

2020-07-02 Thread Martin Neitzel
> > I am not 100% sure how to do the job with NetBSD's date(1). I may > > be just lucky with > > % date -d '+1 month 1 thu' > > Thu Aug 6 00:00:00 CEST 2020 > > because today is the 1st of July. > > Why wait? Try [...] Because yesterday was unsuitable to check for the ambiguity how the