3 ms·
"Use ncal because it provides week numbers and can start weeks on Monday (personal preference)." Use the cal that is in util-linux: https://www.kernel.org/pub
by 1vuio0pswjnm7 5y ago
"Use ncal because it provides week numbers and can start weeks on Monday (personal preference)."
Use the cal that is in util-linux: https://www.kernel.org/pub/linux/utils/util-linux/ https://www.kernel.org/pub/linux/utils/util-linux/
cal -m starts weeks on Monday.
cal -w displays week numbers.
Personal preference is not to install Perl unless needed, e.g., for compiling OpenSSL. Takes up precious space that can be used for other things.
- heresie-dabord 5y agoIn *buntu 20.04, I have cal and ncal. But yes, any common cal utility that generates week numbers is a better solution than cal -y | ... | wc -l. I understand your preference for a lean file system. In this challenge, I needed more than awk (because of arrays) and wanted an explicit solution that works regardless of calendar language.