tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Weekday abbreviations in output of cal(1)



Wolfgang Solfrank <Wolfgang%solfrank.net@localhost> 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 Aug  1 00:00:00 CEST 2020

Alas...

for day in Mon Tue Wed Thu Fri Sat Sun; do
    echo $day = "$(date -d "$(date -d '+1 month' '+%m/01/%C%y') $day")"
done

Mon = Sat Aug  1 00:00:00 MSK 2020
Tue = Sat Aug  1 00:00:00 MSK 2020
Wed = Sat Aug  1 00:00:00 MSK 2020
Thu = Sat Aug  1 00:00:00 MSK 2020
Fri = Sat Aug  1 00:00:00 MSK 2020
Sat = Sat Aug  1 00:00:00 MSK 2020
Sun = Sat Aug  1 00:00:00 MSK 2020


-uwe



Home | Main Index | Thread Index | Old Index