4

It looks like that the format of the month headings in ncal changes with the month. For example:

$ ncal -bh -3 -m 2
                            2021
      Gennaio               Febbraio               Marzo          
lu ma me gi ve sa do  lu ma me gi ve sa do  lu ma me gi ve sa do  
             1  2  3   1  2  3  4  5  6  7   1  2  3  4  5  6  7  
 4  5  6  7  8  9 10   8  9 10 11 12 13 14   8  9 10 11 12 13 14  
11 12 13 14 15 16 17  15 16 17 18 19 20 21  15 16 17 18 19 20 21  
18 19 20 21 22 23 24  22 23 24 25 26 27 28  22 23 24 25 26 27 28  
25 26 27 28 29 30 31

while

$ ncal -bh -3 -m 3
   Febbraio 2021           Marzo 2021           Aprile 2021       
lu ma me gi ve sa do  lu ma me gi ve sa do  lu ma me gi ve sa do  
 1  2  3  4  5  6  7   1  2  3  4  5  6  7            1  2  3  4  
 8  9 10 11 12 13 14   8  9 10 11 12 13 14   5  6  7  8  9 10 11  
15 16 17 18 19 20 21  15 16 17 18 19 20 21  12 13 14 15 16 17 18  
22 23 24 25 26 27 28  22 23 24 25 26 27 28  19 20 21 22 23 24 25  
                      29 30 31              26 27 28 29 30

I can't seem to find any pattern for this behaviour, and also I can't find anything mentioning this behaviour in the manual.

I would like the output to always be in the second format, independently of the month. How do I do that?

I'm on Xubuntu 20.04.1 LTS.

renyhp
  • 143
  • 4

1 Answers1

2

ncal checks whether the display will constitute a subset of the full year’s calendar, and when it does, it prints the year on a separate line, once per year. This happens in non-Julian mode whenever the output contains three months or more, and the first displayed month is the start of a quarter.

As far as I can determine, there is no way to disable this.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • Thanks. Seems like I have to go for something like `paste <(ncal -b -m 1) <(ncal -b -m 2) <(ncal -b -m 3) | sed 's/\t//g'` – renyhp Feb 01 '21 at 10:52
  • Yes, I think the only way to get the output you want is to reconstruct it using separate months as building blocks. – Stephen Kitt Feb 01 '21 at 11:55