CAL(1POSIX)

πŸ’– CAL(1POSIX) πŸ’–

okay bestie, welcome to cal β€” straight out of the POSIX Programmer's Manual, no cap ✨


🌸 PROLOG 🌸

so like, quick lil heads up before we get into it: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so pls consult the corresponding Linux manual page for the deets on Linux behavior), or β€” and I cannot stress this enough β€” the interface might not even be implemented on Linux at all. πŸ™ˆ


✨ NAME ✨

cal β€” print a calendar πŸ—“οΈ


πŸŽ€ SYNOPSIS πŸŽ€

cal [[month] year]

πŸ’… DESCRIPTION πŸ’…

okay so the cal utility shall write a calendar to standard output, and the way it does it is so specific: it uses the Julian calendar for dates from January 1, 1 through September 2, 1752, and the Gregorian calendar for dates from September 14, 1752 through December 31, 9999 β€” as though the Gregorian calendar had been adopted on September 14, 1752. iconic behavior tbh.

now, the vibes change depending on what operands you hand it:

  • no operands? cal shall produce a one-month calendar for the current month in the current year.
  • just the year operand? cal shall produce a calendar for all twelve months in the given calendar year.
  • both month and year? cal shall produce a one-month calendar for the given month in the given year.

🌈 OPTIONS 🌈

None. 😌 literally none. it's giving minimal. it's giving low maintenance. periodt.


πŸ¦‹ OPERANDS πŸ¦‹

The following operands shall be supported:

  • month β€” Specify the month to be displayed, represented as a decimal integer from 1 (January) to 12 (December).
  • year β€” Specify the year for which the calendar is displayed, represented as a decimal integer from 1 to 9999.

πŸ’œ STDIN πŸ’œ

Not used. she doesn't need it bestie, she's independent. πŸ’…


πŸ“ INPUT FILES πŸ“

None.


⭐ ENVIRONMENT VARIABLES ⭐

The following environment variables shall affect the execution of cal:

  • LANG β€” Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1‐2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
  • LC_ALL β€” If set to a non-empty string value, override the values of all the other internationalization variables.
  • LC_CTYPE β€” Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).
  • LC_MESSAGES β€” Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error, and informative messages written to standard output.
  • LC_TIME β€” Determine the format and contents of the calendar. πŸ—“οΈβœ¨
  • NLSPATH β€” Determine the location of message catalogs for the processing of LC_MESSAGES.
  • TZ β€” Determine the timezone used to calculate the value of the current month.

🧚 ASYNCHRONOUS EVENTS 🧚

Default.


πŸ‘‘ STDOUT πŸ‘‘

The standard output shall be used to display the calendar, in an unspecified format. yeah, she's mysterious like that. the format is not our business. πŸ’€


πŸ™ˆ STDERR πŸ™ˆ

The standard error shall be used only for diagnostic messages.


🌸 OUTPUT FILES 🌸

None.


πŸ’– EXTENDED DESCRIPTION πŸ’–

None. nothing extra. she said what she said.


πŸ”₯ EXIT STATUS πŸ”₯

The following exit values shall be returned:

  • 0 β€” Successful completion. πŸŽ‰
  • >0 β€” An error occurred. 😭

πŸŽ€ CONSEQUENCES OF ERRORS πŸŽ€

Default.

The following sections are informative.


πŸ’… APPLICATION USAGE πŸ’…

Note that:

cal 83

refers to A.D. 83, not 1983. bestie please. do not embarrass yourself. πŸ™


🌈 EXAMPLES 🌈

None.


🧠 RATIONALE 🧠

okay so story time πŸ“– β€” earlier versions of this standard incorrectly required that the command:

cal 2000

write a one-month calendar for the current calendar month (no matter what the current year is) in the year 2000 to standard output. and like… that did not match historic practice in any known version of the cal utility. not a single one. πŸ’€

so the description has been updated to match historic practice: when only the year operand is given, cal writes a twelve-month calendar for the specified year. slay. βœ…


πŸ¦„ FUTURE DIRECTIONS πŸ¦„

A future version of this standard may support locale-specific recognition of the date of adoption of the Gregorian calendar. we'll see bestie, we'll see. πŸ‘€


πŸ“š SEE ALSO πŸ“š

The Base Definitions volume of POSIX.1‐2017, Chapter 8, Environment Variables


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page bestie!! 🫢 this one's from IEEE/The Open Group, dated 2017 β€” mwah, thank you for coming to my TED talk, go print a calendar, ily πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from