Displaying week's number in certain format using ncal or cal
29
votes
11
answers
21937
views
Don't you just love it when two commands each do one thing you want but neither do both?
This is what
cal
does. Nice formatting. Lacks week numbers though:
$ cal
January 2012
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
This is what ncal
does. Weird formatting, but with week numbers:
$ ncal -w
January 2012
Su 1 8 15 22 29
Mo 2 9 16 23 30
Tu 3 10 17 24 31
We 4 11 18 25
Th 5 12 19 26
Fr 6 13 20 27
Sa 7 14 21 28
1 2 3 4 5
The kind of output I want, actually a crossbreed between cal
and ncal -w
:
$ cal --magik-calendar-week-option
January 2012
Su Mo Tu We Th Fr Sa
1 1 2 3 4 5 6 7
2 8 9 10 11 12 13 14
3 15 16 17 18 19 20 21
4 22 23 24 25 26 27 28
5 29 30 31
Asked by k0pernikus
(16521 rep)
Jan 19, 2012, 09:53 AM
Last activity: Sep 19, 2022, 01:11 PM
Last activity: Sep 19, 2022, 01:11 PM