tech-userlevel archive

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

Re: Empty lines in output of cal(1)



Am 29.06.20 um 23:47 schrieb Kimmo Suominen:
> On Mon, Jun 29, 2020 at 11:29:10AM -0700, Paul Goyette wrote:
>> Also note that when using ``cal -r'' it still displays 5 lines of
>> output, even though only 3 (or 4) lines contain any day-numbers.
>> This results in somewhat excessive vertical white-spacing.
> 
> When outputting a full year (and possibly in other cases where more
> than one "row" of months is output) the fixed number of display
> lines per month looks more pleasing to the eye, I think.
> 
> But in the single "row" case it would probably be fine to suppress
> the empty lines.  It would seem unlikely that anything depends on
> the fixed number of output lines.  What do you think?

I would actually keep that as it is, for compatibility reasons.

cal(1) on my Linux system (Devuan) always prints the extra line, and so
does cal(1) on OpenBSD.

Also, to the best of my knowledge, parsing the output of cal(1) is about
the only method to get certain calendar information in Unix shell
scripts. And that makes it quite likely that some things actually depend
(more or less) on a fixed number of output lines.


PS: Sorry for sending this reply to the list twice. I replied to the
wrong thread the first time.


Home | Main Index | Thread Index | Old Index